oneTwoThree.pl prints
filterTwoThree.pl checks lines of input and only prints if they match "two" or "three. I want to run something likeone two three
and have this spit outfilterTwoThree.pl | oneTwoThree.pl
Is there a way I can hook these scripts up in one line of dos? I have never used pipes before but I am beginning to see how they could be useful. I think this might be easier in the unix shell... is it worth installing Cygwin so I can use pipes?two three
Thanks for your wisdom!
#!c:/perl/bin/perl #oneTwoThree.pl use warnings; use strict; print "one\n"; print "two\n"; print "three\n";
UPDATE: Maybe the answer is here: How do I store and manipulate the output from another process?#filterTwoAndThree.pl use warnings; use strict; if (/two|three/) { print $_; }
UPDATE: Thanks RazorbladeBidet. I googled around and found many places that suggested dos pipes were somehow handicapped, but in this case I can get what I want to work with, by adding the -n flag
perl oneTwoThree.pl | perl -n filterTwoAndThree.pl
In reply to Process output of one script with another script. by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |