|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | 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 and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
If and Or Condition in Unix [ksh]
I have the code below. I want to said
If TrackErrors > 0 or count == 0 then MailErrors else MailSuccess fi. if [ ${trackErrors} -gt 0 || ${count} -eq 0 ] then MailErrors ${count} else MailSuccess ${count} fi Any helps greatly appreciated. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
I figured out. I hope this will benefit others.
if [ ${trackErrors} -gt 0 -o ${count} -eq 0 ] then MailErrors ${count} else MailSuccess ${count} fi |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
Code:
if [[ ${trackErrors} -gt 0 || ${count} -eq 0 ]]
then
MailErrors ${count}
else
MailSuccess ${count}
fi |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix and db2 where condition issue(new line) | msp2244 | Shell Programming and Scripting | 1 | 02-22-2012 05:03 PM |
| redirect stdout echo command in condition A run in condition B | jao_madn | Shell Programming and Scripting | 3 | 11-02-2011 09:01 PM |
| In unix how we can test or check race condition in a c program by using multi threads | afroze | Programming | 1 | 03-05-2009 05:22 AM |
| In unix how we can test or check race condition in c program by using multi threads | afroze | Linux | 1 | 02-24-2009 10:34 AM |
| if...elif...fi condition in Unix | abidmalik | UNIX for Dummies Questions & Answers | 9 | 09-05-2002 08:35 AM |
|
|