Can anyone explain to me why the following doesn't work?

If condition1 -gt condition2, then continue down the script otherwise, follow 
the OR condition and echo something and then call a function. If I write it as 
follows, Bash ORs the test and the echo and then calls the function regardless 
of result.

[ cond1 -gt cond2 ] || echo something ; call function


If I do it as follows, Bash ignores the OR section altogether and continues 
down the script

[ condi1 -gt cond2 ] || ( echo something ; call function )


This ignores the function call.....

[ cond1 -gt cond2 ] || echo something && call function


....and this calls the function regardless.....


[ cond1 -gt cond2 ] || echo something || call function


I finally broke down and used the if/then construct (I probably should have 
started with that anyway), but it seemed that one of those should have worked. 
Any ideas?


Ray
_______________________________________________
PLUG-applications mailing list
[email protected]
http://lists.plug.phoenix.az.us/cgi-bin/mailman/listinfo/plug-applications

Reminder: All replies will go back to this mailing list. If you wish to send a 
reply to a specific person, please use the reply function and change the 
"To:" address to that person before sending.

Reply via email to