Bruno Costacurta wrote:
Hello,
Hello,
I'm looking about how to work with $? returning from a system call.
Have you read the documentation for that variable?
perldoc perlvar
I have the following :
system("echo 'DIS CHS(*)' | runmqsc SQFR | grep CHANNEL | sort | uniq -c");
print $?;
which is returning correct result :
6 CHANNEL(ADMIN.MQMON) CHLTYPE(SVRCONN)
19 CHANNEL(OLISFA) CHLTYPE(SVRCONN)
1 CHANNEL(QCF1.SQFR) CHLTYPE(RCVR)
20 CHANNEL(SAA.CEDICAM.FR) CHLTYPE(SVRCONN)
1 CHANNEL(SPFR.TO.SQFR) CHLTYPE(RCVR)
1 CHANNEL(SQFR.QCF1) CHLTYPE(SDR)
4 CHANNEL(STRATE.CLIENT) CHLTYPE(SVRCONN)
Question:
using special variable $? how can I ie. cut and summarize first column
containing the figures ?
What does that sentence mean? What would the number returned from the
shell (bash, csh, ksh, etc.) have to do with the numbers output from
"runmqsc SQFR"?
More generally how to work with $? format and value ?
$? contains a numeric value and can be used just like any other number
in Perl.
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/