Mailinglist Archive: opensuse-factory (602 mails)

< Previous Next >
Re: [opensuse-factory] Can we assume that /bin/sh is bash?

On Friday 2019-02-08 13:22, Martin Wilck wrote:

I'm aware that, in principle, /bin/sh is supposed to be the Bourne
shell on Unix systems. But as a matter of fact, on current openSUSE, it
is not.

But it could be. In fact, it can be. `zypper dup` yesterday with an
update block of 120 packages yielded only 7 scriptlet problems when
sh is dash.

If we can't assume that /bin/sh is bash, what else can we assume? I
recall from earlier work that writing really 100% compatible shell code
for all kinds of environments is really hard.

No one needs to write sh-compatible code. The code just needs to be
annotated that it requires a certain interpreter. Since script files
already have a #! line most of the time, that's taken care of.
That leaves script "snippets" that rely on implicit interpreters,
such as in .spec.

Since I literally get to see every new line of spec code due to
factory-review, many specfiles have already gotten their treatment
(if one was even needed). The upside is that specfiles don't need a
lot of work because everyone tries to keep them short anyway and
reuse macros due to the volume of it all.
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
References