[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sed failure in contrib/sboxes on MacOS
From: |
Andreas Kusalananda Kähäri |
Subject: |
Re: Sed failure in contrib/sboxes on MacOS |
Date: |
Sun, 31 Oct 2021 10:02:20 +0100 |
On Sat, Oct 30, 2021 at 12:08:12PM -0400, James K. Lowden wrote:
> On Wed, 27 Oct 2021 20:15:28 +1100
> John Gardner <gardnerjohng@gmail.com> wrote:
>
> > There's already a deprecation warning in-place warning users against
> > relying on the existence of /bin/bash or the assumption that /bin/sh
> > == /bin/bash.
>
> Every so often I get a +10 bump on SO for my answer about writing a
> portable shell script. The answer starts by changing the first line to
>
> #! /bin/sh
>
> because Posix says that shell has to be there. If Posix had a slogan,
> surely it would be "Why mess around with anything else?". ;-)
>
> --jkl
I'd be interested in seeing a reference to where POSIX says that :-)
... because it doesn't. It doesn't say anything about #! in shell
scripts and it say nothing about the location of the sh shell
interpreter or the existance of the /bin directory.
And since most shells don't *enforce* POSIX compliance when running in
sh mode, just shifting to whatever shell impersonates sh might give
a developer a false sense of thinking they're writing a "portable
shell script". The interpreter never cares about calling non-portable
external utilities.
--
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden
.
- Sed failure in contrib/sboxes on MacOS, Axel Kielhorn, 2021/10/26
- Re: Sed failure in contrib/sboxes on MacOS, G. Branden Robinson, 2021/10/26
- Re: Sed failure in contrib/sboxes on MacOS, James K. Lowden, 2021/10/26
- Re: Sed failure in contrib/sboxes on MacOS, Ralph Corderoy, 2021/10/26
- Re: Sed failure in contrib/sboxes on MacOS, G. Branden Robinson, 2021/10/27
- Re: Sed failure in contrib/sboxes on MacOS, John Gardner, 2021/10/27
- Re: Sed failure in contrib/sboxes on MacOS, James K. Lowden, 2021/10/30
- Re: Sed failure in contrib/sboxes on MacOS,
Andreas Kusalananda Kähäri <=
- Re: Sed failure in contrib/sboxes on MacOS, James K. Lowden, 2021/10/31
- Re: Sed failure in contrib/sboxes on MacOS, James K. Lowden, 2021/10/30
Re: Sed failure in contrib/sboxes on MacOS, Andreas Kusalananda Kähäri, 2021/10/26
- Re: Sed failure in contrib/sboxes on MacOS, Andreas Kusalananda Kähäri, 2021/10/26
- Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), G. Branden Robinson, 2021/10/27
- Re: Portability to Mac OS X, Werner LEMBERG, 2021/10/27
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), John Gardner, 2021/10/28
- Re: Portability to Mac OS X, Ingo Schwarze, 2021/10/28
- Re: Portability to Mac OS X, Deri, 2021/10/28
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), John Gardner, 2021/10/28