LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 03-21-2007, 01:17 PM   #1
mathfeel
Member
 
Registered: Feb 2002
Distribution: Gentoo
Posts: 95

Rep: Reputation: 15
output redirect back to file


Is there a way to do the following:

Code:
sort file > file
without doing

Code:
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
 
Old 03-21-2007, 01:28 PM   #2
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 542

Rep: Reputation: 33
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH: How to Redirect Output to File, AND Still Have it on Screen edwin11 Linux - Software 25 07-02-2012 07:12 PM
How to redirect output to a file? mus1402 Linux - Newbie 2 02-05-2006 10:42 AM
redirect screen output to file timbuck Linux - Software 5 12-09-2005 07:57 PM
how to redirect the soundcard output to a file? jr0 Linux - General 2 10-31-2005 07:29 AM
output from cpio won't redirect to file rawii Programming 5 01-27-2004 02:49 PM


All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration