[ale] exit code and if

Michael Hirsch mhirsch at nubridges.com
Thu Jul 18 10:42:15 EDT 2002


On Thu, 2002-07-18 at 10:17, Zyman, Andy wrote:
> Hello ALE,
> as always simple question and looking for Your suggestions:
> 
> cmd
> if [ $? -ne 0 ]; then <do smth> fi
> 
> Is there a better way to this? I mean how i can get rid from this 2 lines
> and make one ?

You could do:
	if ! cmd; then <do sth> ; fi
but I prefer your code.


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list