[arch-general] dash as system /bin/sh? (Was: dash as default shell?)

Eli Schwartz eschwartz at archlinux.org
Thu Jun 18 22:19:00 UTC 2020


On 6/18/20 6:06 PM, Bardur Arantsson wrote:
> On 18/06/2020 18.22, Eli Schwartz via arch-general wrote:
>>> And nearly everybody who has to write this quickly will do it wrong.
>>
>> And yet, some do not. Some write elegant, simple POSIX sh scripts which
>> do it right. For example, people often forget that pipelines and
>> functions are an option, and sometimes a much faster and better option
>> than global state variables.
>>
>> And most people who are writing /bin/bash scripts are *also* doing it
>> wrong because they don't really know what they are doing. Just saying. :p
>>
> 
> This is an argument from the Perfect/Robot programmer and is utterly false.
> 
> We should just collectively face the truth that shell is not a good way
> to program anything non-trivial. :D

I... don't see what you're arguing against?

Someone made an argument that security would be aided by using a larger
shell which has more features that can avoid some of the gross hacks
people sometimes do in POSIX sh.

I argued in response that most people suck at writing bash *anyway*, and
it's possible for people who know what they're doing to write perfectly
safe POSIX sh.

It's immaterial to the discussion either way, but I just figured I would
point out that anyone who I'd actually trust to write shell scripts, I'd
usually trust to write POSIX shell scripts too. So there's no need to
make some arbitrary divide where bash is "safer" than POSIX sh and the
latter should never be used.

Your response is... I'm wrong because only the Perfect/Robot programmer
can write good shell of any kind, and people shouldn't program in shell?
Where did I say people should program in shell?

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1601 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20200618/669a17c3/attachment.sig>


More information about the arch-general mailing list