kirk123 has asked for the wisdom of the Perl Monks concerning the following question:
How do yo execute a unix command in perl and get its output.
Unix command is:
As you can see $name is a perl varible.ls -l $name | wc -l | sed 's/^ *//'
I know you have to use backtick.
I got error when I did it this way:
--kirk123my $number = `ls -l $name | wc -l | sed 's/^ *//''
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Executing unix command in perl and getting the output
by Enlil (Parson) on Jan 14, 2003 at 00:20 UTC | |
|
Re: Executing unix command in perl and getting the output
by rob_au (Abbot) on Jan 14, 2003 at 00:32 UTC | |
by kirk123 (Beadle) on Jan 14, 2003 at 01:34 UTC |