S
sunil
Hi All,
I am trying to execute a complex piped UNIX command in perl
script as follows:
system("nm @ARGV | awk -F\| '$4 == "OBJT " && $5 == "GLOB " {print $8
" " $3}'| grep '^[^$]' | uniq | sort -r | awk '$1 != prevvar
{varstr=sprintf("char %s[%d];",$1,$2);print varstr;prevvar = $1}' |
sort > $ofname");
and it fails with many errors. The errors are compile time errors and
more problems than that. awk uses $0,$1 and I noticed that perl may
substitute its own values for $1....
I tried to get information from PERL documentation and it says that if
I pass entire command and argument list as single scalar (which I am
doing), if there are any shell metacharacters (there are in current
case) it is passed to shell for parsing. Hence it should be able to
execute this.
Any pointers to documentation which can give me more insight into this
or any help will be greatly appreciated.
Thanks,
Sunil.
I am trying to execute a complex piped UNIX command in perl
script as follows:
system("nm @ARGV | awk -F\| '$4 == "OBJT " && $5 == "GLOB " {print $8
" " $3}'| grep '^[^$]' | uniq | sort -r | awk '$1 != prevvar
{varstr=sprintf("char %s[%d];",$1,$2);print varstr;prevvar = $1}' |
sort > $ofname");
and it fails with many errors. The errors are compile time errors and
more problems than that. awk uses $0,$1 and I noticed that perl may
substitute its own values for $1....
I tried to get information from PERL documentation and it says that if
I pass entire command and argument list as single scalar (which I am
doing), if there are any shell metacharacters (there are in current
case) it is passed to shell for parsing. Hence it should be able to
execute this.
Any pointers to documentation which can give me more insight into this
or any help will be greatly appreciated.
Thanks,
Sunil.