If you want to delete the line from the file without copying it, then perhaps sed can help you:
sed -i '/^1 / d' file
seems to work on your test input. The space between the 1 and the / is crucial. Obviously, you'd need to pass a variable from your shell script in place of the 1 if that could change. Oh and note that the i option is for in place change - i.e., it will change the file it is operating on.
Please test things first! I'm not responsible for any data loss!
Last edited by Nylex; 10-16-2010 at 02:04 AM.
|