At 04:21 PM 6/20/01 -0400, Yacketta, Ronald wrote:
> > Well, exec simply replaces your perl script with whatever you
> > give it,
> > so if you want redirection, just use '>'
> >
>
>I have tried that, but exec fails...
>exec ( 'egrep', "-c" , $lookFor , @{$LOGS[($_ -1)]} ) unless $pid=fork; #
>fork new process for cmd
>
>is my current line.. I have tried several different ways to add the > out
>and no go
>exec ( 'egrep', "-c" , $lookFor , @{$LOGS[($_ -1)]}, " >out" ) unless
>$pid=fork; # fork new process for cmd
>results in an error unknown command > out
>
>just need the right syntax
exec "egrep -c $lookFor @{$LOGS[$_ - 1]} >out" ...
Unless you need to protect against malicious entries in @LOGS, this'll get
you going.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com