| Next | Program Repair Shop | 58 |
Subject: problem with awk in perl script
Message-Id: <91qbbv$g9h$1@foo.grnet.gr>
system(`awk '{print $10,$1}' statdata.dat `);
This doesn't work because of quoting problems
($10 and $1 are expanded by Perl before the shell is called)
Instead:
open F, "< statdata.dat" or die ...;
while (<F>) {
my ($status, $name) = (split)[9,0];
print "$status$name\n";
}
close F;
| Next | ![]() |
Copyright © 2006 M. J. Dominus |