Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!wjh12!pixel!pixutl!chris From: chris@pixutl.UUCP (chris) Newsgroups: net.unix,net.unix-wizards Subject: Re: question-- Bourne (and C) SHELL Message-ID: <32@pixutl.UUCP> Date: Tue, 16-Sep-86 16:11:09 EDT Article-I.D.: pixutl.32 Posted: Tue Sep 16 16:11:09 1986 Date-Received: Tue, 16-Sep-86 22:41:37 EDT References: <1751@ittatc.ATC.ITT.UUCP> <7028@utzoo.UUCP> <150@humming.UUCP> <574@ih1ap.UUCP> Organization: xePIX Inc., Nashua, N.H. Lines: 27 Summary: what's wrong with ``[ $? != 0]''??? Xref: mnetor net.unix:5510 net.unix-wizards:7896 > > Correct me if I'm missing something. What's wrong with: > > ls foo > if [ $? != 0 ]; then > echo foo does not exist > fi > -- > > Steve Alesch AT&T > (312)510-7881, ...!ihnp4!ih1ap!sja It should be: if [ $? -ne 0 ]; then '!=' is used to compare strings, -ne and family, integers... :-) Chris -- Chris Bertin : (603) 881-8791 x218 xePIX Inc. : 51 Lake St : {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\ Nashua, NH 03060 : !wjh12!pixel!pixutl!chris