# Martin McCormick: > I wrote a Bourn Shell script which has a while loop in it that > reads a file line by line. The output of the script is supposed to go > to a file with a different name for each iteration of the loop. This > scheme is obviously a rotten idea because all the new files end up > created, but quite empty. If I take out the > $newfilename.txt > directive, I get the proper output at stdout so the only problem is > with changing the file name in the middle of the game several times.
This sounds a bit like a truncation issue. If you do something like command1 > bar # some code command2 > bar then the second redirect will truncate the file to 0 bytes before redirecting the output from command2 into it. Try using >> instead of >, as it appends to the file. If this doesn't help, please post the script (or a simplified version thereof). We're not clairvoyant, you know... :) HTH, Mario _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"