jeremycollake / x-wrt

Automatically exported from code.google.com/p/x-wrt
2 stars 0 forks source link

Use of cat ...|sed > .. is not good #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using "cat file| sed 'something' > file" in postinst-scripts is not good.
It can happen that the > is opening the file before the cat open it. Then
the file will be cleared.
A patch is attached. This also make the "if [ grep = ]" to "if $(grep -q )"
to check only the return code of sed not the output.

Original issue reported on code.google.com by Madu...@gmx.de on 21 Dec 2008 at 9:22

Attachments:

GoogleCodeExporter commented 9 years ago
committed in r4637.

Original comment by kemen04@gmail.com on 8 Jan 2009 at 5:55