[colug-432] Why Bourne Shell Compatible: Portability

Richard Troth rmt at casita.net
Wed Aug 10 09:50:30 EDT 2011


I am really with Jim on this one.
It's not that one shouldn't use BASHisms, just that one should not use
them without thought.

And then Chris mentions DASH.  That's only one of many places where
one cannot ASSume that BASH will be the default shell ... or even
present.  My world is mostly Linux ... MOSTLY.  I've got a FreeBSD
jail which is my primary external server.  /bin/sh on that system is
Berzerkeley Bourne, not BASH.  From the man page, they are moving
toward compliance with "IEEE Std 1003.2 (``POSIX.2'') specification
for the shell".  And there are others (eg: AIX, Solaris, USS).  And I
have one or two Debian (Ubuntu) systems, Linux, but not BASH, dash it
all!  (Been listening to too much Absolute Radio over IPv6, sorry.
British accent stuck in my head!)

If you need a certain BASHism, use it.  No shame in that.  But think
about it first.  Might be that you'd really rather get it done with
Python or Ruby or Tcl or some such.

-- R;   <><





On Tue, Aug 9, 2011 at 21:39,  <jep200404 at columbus.rr.com> wrote:
> On Tue, 9 Aug 2011 21:24:50 -0400, Scott Merrill <skippy at skippy.net> wrote:
>
>> Jim, for the benefit of the class, can you elaborate on the overall
>> benefit of being sh-compatible? What, specifically, are your reasons
>> for wanting to avoid bash-isms?
>
> Portability.
>
> The more one sticks to the narrow confines of compatibility with
> the old Bourne shell, the more environments one's script will
> work in.
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>



More information about the colug-432 mailing list