Hi Gents,
I'm working with awk in a LINUX 7.2 environment.
In an awk execution, I get a printer id and print job number. I want to get the "rank" information on the job from the execution of an lpq statement.
(The lpq data looks like: 1st root 4 .bash_profile 240 bytes)
I've tried several (unsuccessful) methods of getting the data, including putting the output of the data to a file.
My last attempt was:
system("RankLine=`/usr/bin/lpq -P" PrintrID " " JOBNBR " | grep bytes`;export RankLine"
I thought that by exporting the data I could use the ENVIRON parameter to access the data. This approach doesn't work as I think it because it's a different shell execution.
How do you access data from a system call within awk?
Desperately,
gawker
I'm working with awk in a LINUX 7.2 environment.
In an awk execution, I get a printer id and print job number. I want to get the "rank" information on the job from the execution of an lpq statement.
(The lpq data looks like: 1st root 4 .bash_profile 240 bytes)
I've tried several (unsuccessful) methods of getting the data, including putting the output of the data to a file.
My last attempt was:
system("RankLine=`/usr/bin/lpq -P" PrintrID " " JOBNBR " | grep bytes`;export RankLine"
I thought that by exporting the data I could use the ENVIRON parameter to access the data. This approach doesn't work as I think it because it's a different shell execution.
How do you access data from a system call within awk?
Desperately,
gawker