Bourne-shell incompatibilities

Wm E. Davidsen Jr davidsen at sixhub.UUCP
Wed Jan 9 12:52:41 AEST 1991


In article <442 at minya.UUCP> jc at minya.UUCP (John Chambers) writes:

| Often only one of these is accepted by any particular /bin/sh, and the
| other is a syntax error.  Sometimes both are accepted (with different
| meanings).  

  I don't dispute what you say, but I have never seen a sh which didn't
buy {$a-b} notation. Of course the meaning is different when both are
available, the whole : set of expansions was added about SysIII (my
SysIII system is down or I'd check).

${a-b}		if $a is undefined use b instead
${a:-b}		if $a is undefined *or null* use b instead

and so on for all the other operators.
-- 
bill davidsen - davidsen at sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.unix.shell mailing list