-   Linux - Software (
-   -   output redirect back to file (

mathfeel 03-21-2007 01:17 PM

output redirect back to file
Is there a way to do the following:


sort file > file
without doing


sort file > file2
mv file2 file

basically, sort the file and put the output back in the file without having to generate an intermediate file

DotHQ 03-21-2007 01:28 PM

To do this process with a script is pretty easy.
And .... I thought I have seen it done via command line by using the < redirect sysbol to direct the output back into the origial file ....but i tried it on RH and it did not work as expected. I would recommend using a script anyway to save possible data corruption. Just my 2cents. :D

All times are GMT -5. The time now is 04:28 PM.