![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| set Working day in ksh | Rafael.Buria | Shell Programming and Scripting | 1 | 10-09-2007 01:42 AM |
| Not working | Mandab | Shell Programming and Scripting | 7 | 05-11-2007 06:23 PM |
| FTP is not working. | ronald_brayan | Security | 10 | 04-04-2007 05:23 AM |
| sed not working | baanprog | UNIX for Advanced & Expert Users | 5 | 09-18-2006 05:11 AM |
| why is this not working? | matt2kjones | UNIX for Dummies Questions & Answers | 2 | 07-09-2002 12:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
If Else not working
Status=`Executing Some Command`
if [ "${Status}" -ne "0" ] then echo "abc" else echo "..............." command result is Status code = -2 DSJE_BADSTATE but it going to else statement.I beleive IF else is not working here. actual result should be abc. can any one help me to resolve this. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
fi is required
|
|
#3
|
||||
|
||||
|
Use:
Code:
if [ "${Status}" != "0" ]
|
|
#4
|
|||
|
|||
|
i have checked with fi
if fi it should have been give syntax error. Note the status code : either 0 or -2 DJERROR how can we handle these status codes. |
|
#5
|
||||
|
||||
|
What about this one?
if (( ${status} != 0 )) |
|
#6
|
|||
|
|||
|
I have tried with above one.
below message Status code = -2 DSJE_BADSTATE DS_Operations.sh[187]: != 0 : 0403-058 Assignment requires an lvalue. |
|
#7
|
||||
|
||||
|
What values could ${status} get?
|
||||
| Google The UNIX and Linux Forums |