The problem is that the shell and your script aren't sharing a common filepointer. So the shell simply continues to write its second line (which it gets from your script) immediately after the first one where it left off, independently of what your script has written to the file in the meantime... The shell's filepointer is not being advanced when your script is writing to the file. IOW, this won't work.
In reply to Re: How to Write Information to an Opened File
by almut
in thread How to Write Information to an Opened File
by bichonfrise74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |