bfox@AUREL.CALTECH.EDU (Brian Fox) (08/04/89)
Date: Thu, 3 Aug 89 17:13:08 PDT
From: Kayvan Sylvan <kayvan@mrspoc.transact.com>
Sender: kayvan@mrspoc.transact.com
Problem is succinctly stated:
In bourne shell. I'm in a directory containing a file called 'ho'.
$ if [ ! -f ho -a ! -f ho ] ; then echo ho ; else echo YUP ; fi
YUP
$
In bash:
bash$ if [ ! -f ho -a ! -f ho ] ; then echo ho ; else echo YUP ; fi
[: too many arguments
YUP
bash$
This causes numerous shell scripts to fail.
---Kayvan
---
Kayvan Sylvan @ Transact Software, Inc. -*- Mountain View, CA (415) 961-6112
Internet: kayvan@Transact.COM -*- UUCP: ...!{apple,pyramid,mips}!mrspoc!kayvan
Thanks. This problem pointed out to me before, (and a fix given) by
Chet Ramey (chet@pirate.cwru.edu). The problem is the precedence of
`!'.
brian