[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

POSIX shell; bash ash pdksh & /bin/sh

  Before we continue down this road, I'd like to  ask some stupid

  What exactly is a "POSIX shell"?  I know of several different
versions of the POSIX standard, although I've never actually
gotten a look at any of them.  I know of several different versions
of UNIX(tm) that all claim to be POSIX(tm) compliant.  

  For example, Solaris 2.6 claims to be POSIX compliant (although
I am not sure which version).  Yet Solaris 2.6 does *not* have
a POSIX shell as /bin/sh.  I am sure DEC Unix 4.0b claims to be
POSIX compliant, yet its /bin/sh is similarly lacking in "POSIX
shell" features.  As far as I know, a "POSIX shell" is a Bourne
compatible shell that has several features first implemented in
the Korn shell, including such things as $() for subshells and
$(()) for arithmetic.  I only know this because HP-UX claims to 
have a POSIX shell in /bin/sh, and that /bin/sh has these features.
  Because the specific features of the POSIX shell are available
in so few versions of /bin/sh, I hesitate to use them in shell
scripts I write, and would suggest to others that they stick to
the LCD of the 7th edition unix /bin/sh (although it's safe to 
assume that test is a builtin these days, though it isn't in 

  Also, to add more fuel to this fire, the man page of pdksh 
states that there is an explicit POSIX shell mode in pdksh.  I
doubt that the authors of either bash or pdksh actually gave 
anyone any money to certify that their work was actually POSIX
compliant, so we have to take it on faith that they are both
really POSIX compliant and file bug reports if we find that 
they are not actually POSIX compliant.

  And, as a final note, I just compiled pdksh and bash on
my machine.  I compiled bash with the --enable-minimal-config
flag, both were compiled CFLAGS= -O2 and LDFLAGS=-s
pdksh was 176k
bash was 237k

  And pdksh still has command line editing, job control, 
and command history.  ash is still smaller, and has almost
the same functionality as the minimal bash (it has $() and
$(()) but not [[]] so it's probably not "POSIX(tm)" by  some


 Chris Ulrich        cdulrich@ucdavis.edu        530 754 4355

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: