Thread: Just playing
View Single Post
Old Aug 28th, 2006, 10:19 AM   #3
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
> file
truncates (sets the file pointer to the start of an empty file) a file.
It happens before grep runs. Grumpy gave you the workaround.
grep 'stuff ' file1 > tmpfile
mv tmpfile file1
jim mcnamara is offline   Reply With Quote