Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!husc6!harvard!think!nike!lll-crg!lll-lcc!pyramid!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix,net.unix-wizards Subject: Re: sh changes Message-ID: <4227@sun.uucp> Date: Wed, 18-Jun-86 16:23:35 EDT Article-I.D.: sun.4227 Posted: Wed Jun 18 16:23:35 1986 Date-Received: Sat, 21-Jun-86 08:13:27 EDT References: <18951@rochester.ARPA> Organization: Sun Microsystems, Inc. Lines: 49 Xref: watmath net.unix:8261 net.unix-wizards:18499 Summary: because it's better and still compatible. > I hit an incompatability between the 4.2 BSD sh and Sun 3.0 sh. No, you didn't. Keep reading. > 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. > ... > > From Sun 3.0 system: > > ${parameter:-word} > If parameter is set and is non-null, substitute its > value; otherwise substitute word. > In case you missed it, the difference is the extra colon in the Sun 3.0 > system. And the phrase "and is non-null", which appears in the description in the Sun 3.0 manual. Like I said, keep reading. In the 3.0 manual, below that, it says: If the colon (:) is omitted from the above expressions, the shell only checks whether "parameter" is set. So it's a compatible enhancement; you can leave the colon out, and if you do it acts like earlier shells. > Questions: when and why was this change made? It was made in Sun UNIX 3.0, and was made because the System V Release 2 shell, which is the Sun UNIX 3.0 shell, is better than the 4.2BSD shell (faster, more functional, less buggy, you name it). > Are there any other variants of Unix with this change? Any variant using a System III or later shell. > Has anybody's command file broken on account of this? Since it's a compatible enhancement, I tend to doubt it. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)