Rookie Perl Question



I want to run some unix commands from a perl script.

This works, it prints out all lines that don't begin with a # in the
file $ALIASES:

***
$temp = "egrep -v \^# $ALIASES";
system($temp);
***

This doesn't work, it tries to take the egrep output and cut out part
of it:

***
$temp = "egrep -v \^# $ALIASES | cut -d: -f1";
system($temp);
***

I get the following output:

Usage: egrep [OPTION]... PATTERN [FILE]...
Try `egrep --help' for more information.

How can I make this work?

Thanks!

.



Relevant Pages

  • Re: HI help with perl
    ... > What i mean is I want to know how to write a perl script that produces ... > results similar to unix commands like ls, useradd, etc.. ... Now, please go ahead, and read the posting guidelines for this group. ... Sinan Unur ...
    (comp.lang.perl.misc)
  • Re: cut -c18-31,49-51 in perl?
    ... > program is superstition. ... Perl has systemfor a reason. ... So long as 90% of your Perl script isn't system calls to unix commands. ...
    (comp.lang.perl.misc)