develooper Front page | perl.beginners | Postings from April 2010

special variable $? usage

Thread Next
From:
Bruno Costacurta
Date:
April 22, 2010 05:05
Subject:
special variable $? usage
Message ID:
20100422140448.19192qvvxyhfgq68@webmail.costacurta.org
Hello,

I'm looking about how to work with $? returning from a system call.
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 ?
More generally how to work with $? format and value ?

Thanks.
Bye,
Bruno


-- 
Linux Counter #353844
http://counter.li.org/


----------------------------------------------------------------


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About