Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!gatech!seismo!rochester!ken From: ken@rochester.ARPA (Comfy chair) Newsgroups: net.unix,net.unix-wizards Subject: sh changes Message-ID: <18951@rochester.ARPA> Date: Tue, 17-Jun-86 13:25:36 EDT Article-I.D.: rocheste.18951 Posted: Tue Jun 17 13:25:36 1986 Date-Received: Thu, 19-Jun-86 08:26:08 EDT Reply-To: ken@rochester.UUCP (Comfy chair) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 47 Xref: watmath net.unix:8206 net.unix-wizards:18445 Summary: why? References: I hit an incompatability between the 4.2 BSD sh and Sun 3.0 sh. Here are the relevant parts of the manual pages: From 4.2 BSD system: ${parameter-word} If parameter is set, substitute its value; otherwise substitute word. ${parameter=word} If parameter is not set, set it to word; the value of the parameter is then substituted. Positional parame- ters may not be assigned to in this way. ${parameter?word} If parameter is set, substitute its value; otherwise, print word and exit from the shell. If word is omit- ted, a standard message is printed. ${parameter+word} If parameter is set, substitute word; otherwise substi- tute nothing. From Sun 3.0 system: ${parameter:-word} If parameter is set and is non-null, substitute its value; otherwise substitute word. ${parameter:=word} If parameter is not set or is null set it to word; the value of the parameter is substituted. Positional parameters may not be assigned to in this way. ${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. ${parameter:+word} If parameter is set and is non-null, substitute word; otherwise substitute nothing. In case you missed it, the difference is the extra colon in the Sun 3.0 system. Questions: when and why was this change made? Are there any other variants of Unix with this change? Has anybody's command file broken on account of this? Ken -- UUCP: ..!{allegra,decvax,seismo}!rochester!ken ARPA: ken@rochester.arpa Snail: CS Dept., U. of Roch., NY 14627. Voice: Ken!