question-- Bourne (and C) SHELL

chris chris at pixutl.UUCP
Wed Sep 17 06:11:09 AEST 1986


> 
> 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



More information about the Comp.unix.wizards mailing list