LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 03: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 03:19 PM.
 
Old 02-27-2010, 03:35 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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, 03: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, 04:04 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
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


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


All times are GMT -5. The time now is 02:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration