On Mon, Apr 26, 1999 at 11:41:01PM -0500, Adam Rogoyski wrote:
| On Mon, 26 Apr 1999, Doug McLaren wrote:
| 
| > | > Broken shell scripts and non portable code are the result of lame
| > | > programmers, not Linux's use of bash.  He must never have seen AIX!
| > | 
| > |    NetBSD uses ash and csh for most everything, Linux uses Bash, and AIX
| > | uses the Korn shell.  There are differences between them.  AIX uses
| > | nothing but regular Korn shell which has very well documented behavior. 
| > 
| > If you write shell scripts in csh, you get what you deserve.
| 
|    Wow, what does this have to do with what we're talking about?  

I'm not sure.  You did say that `NetBSD uses ash and csh for most
everything' ...

| 
| > AIX does indeed use the Korn shell, and /bin/sh is really the Korn
| > shell.
| 
|    No, /bin/sh is the Posix shell.  Guess which ones fit that category.

   % uname -a
   AIX mandarina 2 4 006165664C00

   % dir /bin/sh /bin/ksh /bin/bsh
   -r-xr-xr-x   2 bin      bin        361436 Apr  1  1997 /bin/bsh
   -r-xr-xr-x   4 bin      bin        233830 Mar 26  1997 /bin/ksh
   -r-xr-xr-x   4 bin      bin        233830 Mar 26  1997 /bin/sh

   % man sh
   sh Command
   Purpose
   Invokes the default shell.
   Syntax
   Refer to the syntax of the ksh command. The /usr/bin/sh file is linked
   to the Korn shell.

So, under AIX, /bin/sh is the Korn shell.  If you want to call it the
Posix shell as well, feel free, but it's still the Korn shell.  I'm
not sure (and don't care) how `posix' it is so I won't touch that (the
AIX man page doesn't make any such claims.  Doesn't mean it's not
true, of course.)

| > If you want the Bourne shell, you need to use /bin/bsh.
| > Causes about the same number of problems as Linux's /bin/sh being bash
| > rather than the Bourne shell.
| 
|    If you want to use NetBSD ash as your /bin/sh, go ahead.

What did that have to do with using /bin/bsh ?  Which OS are you
talking about, anyways?

| I can even
| send you some patches to make it almost usable.  You won't gain anything
| though.

You might save a little memory.  It wouldn't be worth it except maybe
on some extremely memory starved box (like having 4mb of ram),
however.

Personally I don't have any problems using sh, ash, ksh or bash - it's
really quite simple to make scripts that work with all four.

| Neither would AIX in switching off the Korn shell (not that the
| set -o vi ibm people would consider it).  The differences are small enough
| and obscure enough that one could learn them and fix anything rare
| problems.

Yes, that's correct.  AIX's /bin/sh is the Korn shell, and there's a
few (quite few) programs out there that don't like it and need to be
run with /bin/bsh.  Similarly, most Bourne shell scripts run fine with
Linux's /bin/sh (which is really bash.)

(As an example, one script that doesn't like AIX's ksh is the
Configure that's part of trn -

   if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
           if test X`/usr/bin/uname -v` = X4; then
                   avoidksh="to avoid AIX 4's /bin/sh"
                   newsh=/usr/bin/bsh
           fi
   fi

Problems like that are rare, but they do exist, both under Linux and
AIX.  And in most cases, they're minor and easy to work around.)

The *real* problems come when people get used to /bin/sh having the
ksh or bash extensions and start writing their programs to use them,
then they find that their scripts don't work on other OS's ...

And ultimately that's probably what the original `bozo author' was
complaining about ...

The only reason I brought up AIX at all is to point out that it has a
`problem' that's very similar to what thie `bozo author' was
attributing to Linux.

-- 
Doug McLaren, [EMAIL PROTECTED]
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to