bash scripting across linux and solaris

David Hummel lemmuh-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Aug 28 16:00:37 EDT 2009


On Fri, Aug 28, 2009 at 3:42 PM, Theodore Ruegsegger<gruntly-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
>
> Well, POSIX aside, if you call bash as sh, it clearly doesn't behave
> as sh, as my little experiment with the array showed.

With due respect, I don't think your experiment showed this.  You were
attempting to use bash-specific syntax in sh.  If you were writing
your scripts for portability, you presumably wouldn't be including
bash-specific syntax, and bash doesn't ignore it's own semantics when
called as sh.  If you removed all bash-specific syntax, I'm fairly
certain (with some minor exceptions aside) that you would get the same
result in both sh and bash.

> Come to think of it, while I'd agree bash is way more comfortable then
> sh as an interactive shell, I'm not sure bash is "far superior" as a
> script language. Has a few additional, rarely-used features (that can
> confuse maintainers) but is otherwise pretty much the same, I'd say.
> On the other hand, some of the syntax improvements certainly aid
> readability and therefore maintainability; it's just the "far" I'm
> disputing.

Point taken.  How about "better" ;-)





More information about the Discuss mailing list