A
amanjun
Hi
I am trying to use "pipe" as in the unix command line sense in Perl
below:
for(`ls $ARGV[0]`)
{
$contents = `ls $_ \| wc \| awk '{print $1}'` ;
print $contents if ($contents != 0) ;
}
Here I am trying to findout the empty directories in $ARGV[0].
It gives errors like:
sh: -c: line 2: syntax error near unexpected token `|w'
sh: -c: line 2: ` |wc'
Can any of you help me in implementing this function?
Thank you.
Manju
I am trying to use "pipe" as in the unix command line sense in Perl
below:
for(`ls $ARGV[0]`)
{
$contents = `ls $_ \| wc \| awk '{print $1}'` ;
print $contents if ($contents != 0) ;
}
Here I am trying to findout the empty directories in $ARGV[0].
It gives errors like:
sh: -c: line 2: syntax error near unexpected token `|w'
sh: -c: line 2: ` |wc'
Can any of you help me in implementing this function?
Thank you.
Manju