Hello Devdas.... Thanks for the help... but I want to check the exit code.... How can I access the exit code and assign the exit code value to a variable. I tried using the command var=`ping -c1 -w3 202.54.1.30` echo $var
This still outputs the regulr ping output | if my eth crd is down...it still o/p's "connect : Network is unreachable" directly to the monitor,without assigning the Exit Code value to the variable. Vidhata
Foundation of a good theory is to invent it and keep it open for questioning. ___________________________________________________ Meet your old school or college friends from 1 Million + database... Click here to reunite www.batchmates.com/rediff.asp
On 12 Aug 2003, Vidhata Deshpande wrote:
How can I access the exit code and assign the exit code value to a
exit codes are stored in $? when the program exits. I suggest you read the bash man page.
Oh, and please use a meanigful subject line.
Philip
On Tue, Aug 12, 2003 at 08:41:01AM -0000, Vidhata Deshpande wrote:
How can I access the exit code and assign the exit code value to a variable. I tried using the command var=`ping -c1 -w3 202.54.1.30` echo $var
try
ping -c1 -w3 202.54.1.30 var=$? echo $var
HTH With regards,