Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!odin!chet From: chet@odin.INS.CWRU.Edu (Chet Ramey) Newsgroups: comp.unix.shell Subject: Re: Finding the last arg Keywords: Bourne shell arguments Message-ID: <1991Jan2.174157.21530@usenet.ins.cwru.edu> Date: 2 Jan 91 17:41:57 GMT References: <18476@shlump.nac.dec.com> <3074@wyse.wyse.com> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 51 Nntp-Posting-Host: odin.ins.cwru.edu >>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. The BSD /bin/sh is the one from v7, with minimal changes for the 4.2 BSD signal semantics (restarted system calls, etc.) and # as a comment character. The AT&T /bin/sh changed drastically beginning with System V.2, and further changes appeared in System V.3. Here's a short list of what was added to the v7 sh for the System V.2 sh: shell functions and the `return' builtin redirection of input/output for builtins (e.g. `read x < /dev/tty') command hashing, `set -h', and the hash builtin test/[, echo, pwd, ulimit builtins exit status of a pipeline was defined to be the exit status of the last command set -a, set -f # as the comment character (this was put in at Berkeley and adopted by AT&T) colon form of parameter substitution to test for nullness of a variable CDPATH MAILCHECK, MAILPATH the use of `!' to negate a [] pattern for filename generation the `<<-' form of here-document redirection (strip leading tabs) set -- numeric parameter to the shift builtin the unset builtin (!) restricted shell mode There were a few changes between the System V.2 sh and the V.3 sh, in addition to bug fixes: the shell is now 8-bit clean (that is, the shell no longer implements quoting by turning on the 8th bit of characters) function arguments no longer overwrite the global set of positional parameters the getopts builtin The BSD /bin/sh, which is still pretty much the V7 /bin/sh, includes `login' as a builtin and allows `chdir' as a synonym for `cd'. The System V shell includes `newgrp' as a builtin. As of 4.3 BSD, the BSD sh accepts # as a comment only when non-interactive. Chet -- Chet Ramey ``I die, Horatio'' Network Services Group, Case Western Reserve University chet@ins.CWRU.Edu My opinions are just those, and mine alone.