The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's manas6 UNIX for Dummies Questions & Answers 0 06-05-2008 03:44 AM
sendmail return code trichyselva Shell Programming and Scripting 0 04-02-2008 04:20 AM
Incorporte Return Code u263066 Shell Programming and Scripting 2 09-06-2006 01:58 AM
Return Code of tar in AIX dupeng AIX 3 02-22-2004 08:05 PM
return code from oracle lesstjm Shell Programming and Scripting 3 01-29-2002 11:50 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-28-2007
Registered User
 

Join Date: Sep 2005
Posts: 78
asking about return code

hi all
my system is linux red hat
i have a script that runs some object .
the object return some code to the system
i see the code by writing echo $?
i want to ask in the script if $? equals 14
how shell is do that in the script
thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-28-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Quote:
Originally Posted by naamas03 View Post
i want to ask in the script if $? equals 14
how shell is do that in the script
Code:
if [[ $? -eq 14 ]] ; then
  echo "Return status is 14"
else
  echo "Return status is not 14"
fi
Reply With Quote
  #3 (permalink)  
Old 08-28-2007
Registered User
 

Join Date: Oct 2004
Posts: 215
Heloo...

you can do like


if [ $? -eq 14 ]
then
your tasks...
fi

Thanks,
Arun
Reply With Quote
  #4 (permalink)  
Old 08-28-2007
Registered User
 

Join Date: Sep 2005
Posts: 78
thank you very much
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0