LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-12-2007, 06:47 AM   #1
khairilthegreat
LQ Newbie
 
Registered: Oct 2006
Distribution: Kubuntu
Posts: 25

Rep: Reputation: 15
save file from std input


How can I save all input from a pipe command to a text file.

For example:
Code:
# cat any.text | ????? > new.text
What command will substitute ????? so the output of "cat any.txt " could be saved to another file. It's not about simply redirecting the "cat" command to file (using >), but a command to process something from stdin to create a file containing all output process.

One solution I could imagine is using "grep . > new.text", but this command will cut the space between the output. Is there any other solution.

Last edited by khairilthegreat; 08-12-2007 at 07:18 AM.
 
Old 08-12-2007, 08:07 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
If I understand your question correctly, then do this at the shell prompt:

Code:
man tee
and all will be revealed.
 
Old 08-13-2007, 12:10 AM   #3
iceman_san
LQ Newbie
 
Registered: Aug 2007
Posts: 21

Rep: Reputation: 15
hope this will help u ,

cat any.text | >&1 tee -a new.text
 
Old 08-13-2007, 02:04 AM   #4
khairilthegreat
LQ Newbie
 
Registered: Oct 2006
Distribution: Kubuntu
Posts: 25

Original Poster
Rep: Reputation: 15
thanks

Thank you all. tee is the command I looking for.
 
  


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
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM
[Perl] cgi.pm - save input in .html file noir911 Programming 2 01-07-2007 02:36 PM
C program that takes input "FName|LName" and outputs to std out its_godzilla Programming 2 01-18-2005 10:26 PM
Not able to save file shadow11 Linux - Newbie 4 10-21-2004 08:15 PM
Mozilla 1.7 - No File Save / File Open dialogs on Slackware 10.0 jayseye Slackware 8 08-10-2004 05:52 AM


All times are GMT -5. The time now is 05:52 AM.

Main Menu
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