command arguments

Steve Schoch schoch at sheba.arc.nasa.gov
Sat Nov 10 08:06:31 AEST 1990


In article <1990Nov8.144527.10834 at decuac.dec.com>, mjr at hussar.dco.dec.com (Marcus J. Ranum) writes:
|> 
|> >2)  Why on ^C does it truncate the file?  (Nice error handling :-)
|> 
|> 	It's probably not that ^C truncated the file, but when sort
|> opened the file for output, it truncated it then. When you hit ^C it
|> just exitted, leaving the file already truncated.

No, that's not right.  Sort can take the same file for input and output
with:

	% sort -o file file

and in this case it's can't overwrite the file before it has read it.  Sort
only opens the file for writing after it has sorted all the data.

The problem might be that when you said:   % sort -ofile anotherfile
it just took "file" as more options and one of those options could have
produced the symptons.

	Steve



More information about the Comp.unix.ultrix mailing list