Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!ames!sheba.arc.nasa.gov!schoch From: schoch@sheba.arc.nasa.gov (Steve Schoch) Newsgroups: comp.unix.ultrix Subject: Re: command arguments Keywords: OHMYGOD! What happened to my file! F***! Message-ID: <1990Nov9.210631.8781@news.arc.nasa.gov> Date: 9 Nov 90 21:06:31 GMT References: <714@isgtec.UUCP> <1990Nov8.144527.10834@decuac.dec.com> Sender: usenet@news.arc.nasa.gov (USENET Administration) Reply-To: schoch@trident.arc.nasa.gov (Steve Schoch) Organization: NASA Ames Research Center, Moffett Field, CA Lines: 21 In article <1990Nov8.144527.10834@decuac.dec.com>, mjr@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