Mailinglist Archive: opensuse-factory (602 mails)

< Previous Next >
Re: [opensuse-factory] Can we assume that /bin/sh is bash?
  • From: Mischa Salle <mischa.salle@xxxxxxxxx>
  • Date: Tue, 19 Feb 2019 18:12:37 +0100
  • Message-id: <CAD38tB0G9J6=cA_v508EyrXhrYsZpNeHZXn6DWJVFr8ZrTJG9Q@mail.gmail.com>
On Tue, Feb 19, 2019 at 5:13 PM Neal Gompa <ngompa13@xxxxxxxxx> wrote:

We should either say a) "YES, /bin/sh is always bash on openSUSE" (like
Fedora), or b) "/bin/sh could be any POSIX compliant shell" (like
Debian). In case a), removing bashisms would be pointless and wrong and
should therefore be discouraged.

I see no point in going the Debian route. Forcing people to write
scriptlets purely in POSIX is just adding pain for no benefit. The
_only_ reason Debian enforces it is because they have a case where
their init is a shell script. And even then, it's easy enough to argue
otherwise since Bash continues to evolve and improve.

No one is suggesting you have to write POSIX-compliant scripts, except
in the case when you use #!/bin/sh. If you want to use
any-other-shell-specifics, then specify that shell instead.

In any case I would certainly go for option b) which allows the
freedom to symlink /bin/sh to a faster performing or more POSIX
compliant shell.
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >