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";