Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2017 10:49:30 -0500
From:      Roger Pate <>
To:        Manish Jain <>
Cc:        "" <>
Subject:   Re: Variable assignment in sh
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <> <> <> <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Wed, Feb 1, 2017 at 10:23 AM, Manish Jain
<> wrote:
> On 02/01/2017 08:36 PM, Roger Pate wrote:
>> Most often, but not always, if I need something bash has and /bin/sh
>> lacks, it's time to write that script in a different language. :P
> Generally, FreeBSD community is averse to bash scritpting. But then sh
> lacks array support, which is where bash and zsh do wonderfully well.

Not just FreeBSD community, but I won't belabor the point.

In particular about arrays, remember that sh does support one array
well: $@, both global and per-function.  If two arrays are needed, but
one can be setup in a for loop (useful for globbing files) or list of
lines/NUL-terminated-items (pipe into a while loop or process
xargs-like), then you are also good to go.

> Generally again, I am averse to most Linuxisms, but bash is simply way
> too much convenience to ignore.

I used to believe so too, but now I am happier writing more complex
scripts in Python.  Around the same time, I coincidentally switched my
interactive shell from bash to zsh (though I don't use zsh for
scripting), and also recommend that.

Want to link to this message? Use this URL: <>