|
|
| We don't bite newbies here... much | |
| PerlMonks |
redirect grep outputby Anonymous Monk |
| on Jan 12, 2001 at 17:23 UTC ( [id://51421]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Below is a snippet of a simple script giving me problems. The first use of fgrep marked (1) redirects GREAT. The last 4 marked (2) simply output to the screen and ignore my pipe! If I change the $log to a constant it works fine? Any ideas? #Scan the log dir for useful logfiles chdir ("$BackPath"); (1) system "fgrep -l $Date * > /nwscan/tmplog"; chdir ("$MainPath"); $log1 = $target[0]; $log2 = $target1; $log3 = $target2; #print $log1; #print $log2; #print $log3; chdir ("$BackPath"); (2)system "fgrep server $log1>>/nwscan/$Server"; (2)system "fgrep type $log1>>/nwscan/$Server"; (2)system "fgrep started $log1>>/nwscan/$Server"; (2)system "fgrep completion $log1>>/nwscan/$Server";
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||