Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

referring to standard input in a unix pipeline

passing output from perl script between unix scripts

10:28 pm on Mar 29, 2006 (gmt 0)

10+ Year Member

hey everyone,

I have the following question.

I have a unix script script1 which invokes a perl script and gets some output from it. The perl script has one print statement at the end which sends the data to stdout


print STDOUT $log;

my unix pipeline looks like this:


script 1 ¦ script 2

how can script 2 refer to the output from script 1 (which is output from a perl script) .. is it with $1? or is that just command line variables?

any help appreciated,
Alex ...

1:45 pm on Mar 30, 2006 (gmt 0)

10+ Year Member

while (my $line = <STDIN>) {
$line =~ s/a/b/;
print $line;

or, for the uber-efficient, $_ is implied pretty much everywhere -

while (<STDIN>) {

12:01 am on Mar 31, 2006 (gmt 0)

10+ Year Member

worked fine, thanks!

Featured Threads

Hot Threads This Week

Hot Threads This Month