Re: bash: WHY???
From: Rich Teer (rich.teer@rite-group.com)
Date: 04/08/03
- Next message: Rich Teer: "Re: bash: WHY???"
- Previous message: bugbear: "running olwm under a VNC Xserver?"
- In reply to: bob@cemetery.homeunix.org: "Re: bash: WHY???"
- Next in thread: rmk@rmkhome.com: "Re: bash: WHY???"
- Reply: rmk@rmkhome.com: "Re: bash: WHY???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Rich Teer <rich.teer@rite-group.com> Date: Tue, 08 Apr 2003 16:36:28 GMT
On Tue, 8 Apr 2003 bob@cemetery.homeunix.org wrote:
> Sometimes you break a little backwards compatibility as you move
> forward. IMHO bash 2.05+ is the most usable interactive shell as it has
> the best completion, although I hate it's 'features' used in scripting,
> eg. 'select' instead of '.', different ways of doing maths instead of
> $(($a+$b)).
Note that I am NOT advocating against bash - I'm sure it's a
fine shell. WHay I'm complaining about is (some of) the Linux
communitie's desire to call it "sh", when it clearly isn't.
> #!bash
Well, that's non-portable for a start. The command in a shebang
must be an absolute pathname; $PATH should not be used.
> I don't have /bin/bash on any of my machines. /usr/bin/bash or
> /usr/local/bin/bash.
On Solaris, /bin is a symlink to /usr/bin. I don't know about
other OSes.
> So much for the compatibility of your scripts when you start with such a
> major assumption. Maybe you should look for the obvious before delving
> too deep into sh dialects.
Indeed. Pot and kettle?
> If it's compatible enough for most things to work then most people are
> going to be happy. bash is so ubiquitous these days it _is_ the standard
Ubiquity does not a standard make. Heck, in that case Windoze's
DOS prompt is the "default shell", because it's so ubiquitous.
> /bin/sh, anybody writing sh script these days would be mad to write
> stuff that won't work with bash.
Why? IF the Linux community came clean and either made bash fully
sh compilant (when invoked by that name at least), then this wouldn't
be an issue. I guess that's one of the differences between prefessional
programmers and (I hate to use one of Don's expressions) SuFERd00ds.
The former DO care about backwards compatibilty.
> If you're talking about maintaining compatibility with old stuff then
> that becomes less important every day. If I had to make a choice between
Try telling Sun's customers that.
> reference 'sh' compatible and bash compatible I would go for bash as it
OK - but call it a bash script, not an sh script.
> is everywhere.
It's not on my system.
> The 'C' shell needs die. I have yet to hear any good arguments in it's
> favour.
To each their own. I used to like csh for interactive use
(when my only alternative was sh), if only for !! and !$.
> PS pdksh is my favourite overall...
My shell of choice is ksh. Of the three shells that were
available out of the box on Solaris when I started using it,
ksh had the best feature set (my fondness for !! and !$
notwithstanding). I don't need command completion (I'm quite
capable of using metacharacters like *), and I certainly
don't need arrow key history edittinng. Why? Because as a
long time vi user, I'm more used to using hjkl as cursor keys
than the cursor keys themselves. Plus, I like being able to
search through my command history using Esc-/<string>.
The differences is that if I write a script, I write it by
default in sh using sh features. IF I need a more advanced
feature (like, say, arrays), then I'll write it in ksh. But
the first line of my script will be #!/bin/ksh, #!/bin/sh.
-- Rich Teer, SCNA President, Rite Online Inc. Voice: +1 (250) 979-1638 URL: http://www.rite-online.net
- Next message: Rich Teer: "Re: bash: WHY???"
- Previous message: bugbear: "running olwm under a VNC Xserver?"
- In reply to: bob@cemetery.homeunix.org: "Re: bash: WHY???"
- Next in thread: rmk@rmkhome.com: "Re: bash: WHY???"
- Reply: rmk@rmkhome.com: "Re: bash: WHY???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|