LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 02-27-2010, 02:00 PM   #1
jayant17
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Pipes


Hi,

How should I direct the output of my program, which is a very huge file, (in gigabytes) as an input to a different program through pipes in linux. I have scripts written for both the programs.

I'll appreciate a quick response.

Last edited by jayant17; 02-27-2010 at 02:19 PM.
 
Old 02-27-2010, 02:35 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I don't understand the question. If you want to use a pipe, then there's nothing to ask.
Code:
script1 | script 2
Are you referring to named pipes and fifo's? if so then just use mkfifo to make the fifo and use that as the output file name in the first script. But then that is not redirection...
 
Old 02-27-2010, 02:35 PM   #3
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

Code:
cat OUTPUT_FILENAME | MYPROGRAM
should do the job.
 
Old 02-27-2010, 03:04 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Feed the outpur of prog1 into the input of prog2:

prog1 | prog2

Feed the output of prog1 into a file:

prog1 > filename

Append the output of prog1 to a file:

prog1 >> filename

Feed a file into the input of prog1:

prog1 < filename

-- or --

cat filename | prog1
 
  


Reply



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
pipes leedude Programming 4 05-20-2008 06:52 PM
how to use pipes? rabbit2345 Linux - Software 2 03-29-2008 01:52 PM
ls pipes and wc 7stud Linux - Newbie 7 02-27-2007 07:24 AM
pipes smart girl Programming 6 04-30-2006 10:20 AM
about pipes kpachopoulos Programming 1 10-15-2005 12:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:00 PM.

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
Open Source Consulting | Domain Registration