Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!mips!swrinde!elroy.jpl.nasa.gov!usc!wuarchive!mit-eddie!minya!jc From: jc@minya.UUCP (John Chambers) Newsgroups: comp.unix.shell Subject: Re: Bourne-shell incompatibilities Keywords: Bourne shell arguments Message-ID: <442@minya.UUCP> Date: 5 Jan 91 14:35:27 GMT References: <18476@shlump.nac.dec.com> <3074@wyse.wyse.com> Lines: 25 > >The problem is that I can't figure out any Bourne-shell expression that > >gives the last argument. In C-shell, it's easy (argv[$#]). But I need > >to write Bourne shell scripts. In fact, they need to be BSD bourne shell > >scripts rather that ATT Bourne shell scripts. The difference is probably > >significant here, because of the differences in the way these two Bourne > > As an aside, could you explain this comment? I have had minimal contact > with BSD, but my experience does not seem to support this statement. Well, one difference that has bitten me is ${x-foo} versus: ${x:-foo} 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). BSD /bin/sh usually only understands the first format, and the script dies if you use the second format. (Isn't it wonderful to have such a nice tool for portable scripts? ;-) -- Zippy-Says: Imagine ... a world without clothing folds, chiaroscuro, or marital difficulties ... Home: 1-617-484-6393 Work: 1-508-952-3274 Uucp: ...!{harvard.edu,ima.com,eddie.mit.edu,ora.com}!minya!jc (John Chambers) Uucp-map: minya adelie(DEAD)