qx and awk for array

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi Y'all,

  Having trouble with this command when placed in a perl script:

cat /tmp/filesontape | awk '{print $9}'

on the command line output is as follows:

output from script is as follows:
-rwxr-xr-x   1 root     root       550592 Feb 12  2002 /etc/LGTOuscsi/sjirdtag
 -rwxr-xr-x   1 root     root       550816 Feb 12  2002 /etc/LGTOuscsi/sjirelem
 -rwxr-xr-x   1 root     root       550544 Feb 12  2002 /etc/LGTOuscsi/sjirjc
I read perldoc perlop for qx and it claims that it honors pipes, and
wildcards etc.  any thoughts?

here is the script:


my $cpioin = '/tmp/cpioin';
my $putontape = '/tmp/filesontape';

open(FH3, "$cpioin") or die "cant get FH3 $cpioin:$!";

my @pretape = <FH3>;
close FH3;

my @posttape = qx/cat $putontape | awk '{print $9}'/;

print "@posttape";

Thanks in advance,

Site Timeline