Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox From: bfox@AUREL.CALTECH.EDU (Brian Fox) Newsgroups: gnu.bash.bug Subject: parameter tests in Bourne shell Message-ID: <8908241652.AA07471@aurel.caltech.edu> Date: 24 Aug 89 16:52:19 GMT References: <8908240229.AA18965@hub.ucsb.edu> Sender: daemon@tut.cis.ohio-state.edu Reply-To: bfox@aurel.caltech.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32 From: Jim Frew Date: 23 Aug 1989 1927-PDT (Wednesday) In a recent bug-bash posting, cwjcc!kiwi!chet@gatech.edu (Chet Ramey) writes: > ... this behavior has been in the Bourne > shell since its creation (i.e. 7th Edition). Quoting from a random System > 5 release 2+ man page (this happens to be from Ultrix 3.0 sh5): > > ${parameter:?word} > If parameter is set and is non-null, substitute its > value; otherwise, print word and exit from the shell. > If word is omitted, the message ``parameter null or not > set'' is printed. > > The wording is essentially the same for the 4.3BSD sh, which means it was in > the 7th Edition sh. For the record, the use of ":" to test whether the parameter is null was NOT documented in the 7th Edition Bourne shell. The V7 manual page sez: ${parameter?word} If parameter is set then substitute its value; otherwise, print word and exit from the shell. If word is omitted then a standard message is printed. The ":" isn't what we are complaining about, it is the "?" that is causing the behaviour in question. Brian Fox