How to do <cmd> file | hold file

Joe Smith jms at tardis.Tymnet.COM
Sat Sep 8 10:34:09 AEST 1990


In article <2274 at ns-mx.uiowa.edu> jlhaferman at l_cae07.icaen.uiowa.edu (Jeffrey Lawrence Haferman) writes:
>For example, suppose I want to sort a file and place the result in the same
>file without destroying it, e.g.
>   % sort file > tmp; mv tmp file

You can use "sort file -o file" for that particular problem.  (It's in the
man pages.)

In general, you have to find a suitable location to hold the file, then
mv it to the destination.  Buffering the entire file in RAM does not work
for large files.
-- 
Joe Smith (408)922-6220 | SMTP: jms at tardis.tymnet.com or jms at gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41    | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."



More information about the Comp.unix.shell mailing list