Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!ukma!usenet.ins.cwru.edu!odin!chet From: chet@odin.INS.CWRU.Edu (Chet Ramey) Newsgroups: comp.unix.shell,sublink.lang.shell Subject: Re: Bourne Shell bug? Have a look.. Message-ID: <1991Jan16.152933.7288@usenet.ins.cwru.edu> Date: 16 Jan 91 15:29:33 GMT References: <1174@otello.sublink.org> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 32 Nntp-Posting-Host: odin.ins.cwru.edu Paolo Ventafridda writes: $ Please have a look at this small program written in standard $ Bourne shell: $ $ : $ set "one two three 4" $ if [ "`echo $@ | grep '4'" != "" ]; then $ echo "Four" $ fi $ $ $ Now, notice that a ` is missing in the "if" above! $ It works without any problems all the same: on Xenix, SCO Unix, $ 3B2, HP-UX and i guess on any bourne shell whose sources are $ coming from at&t. $ It seems that only BASH gets the error. The `standard' AT&T Bourne shell will silently add a missing closing delimiter when it hits EOF. I don't think ksh does, except maybe for sh compatibility; this was listed by Korn in his book as one of the differences between ksh and sh. Bash doesn't either. Chet -- Chet Ramey ``There's just no surf in Network Services Group Cleveland, U.S.A. ...'' Case Western Reserve University chet@ins.CWRU.Edu My opinions are just those, and mine alone.