Article View: alt.folklore.computers
Article #895Re: bash on macOS
From: Waldek Hebisch
Date: Fri, 06 Nov 2026 21:52
Date: Fri, 06 Nov 2026 21:52
48 lines
3353 bytes
3353 bytes
Nuno Silva <nunojsilva@invalid.invalid> wrote:
> On 2026-11-06, Peter Flass wrote:
>
>> On 11/6/26 06:59, Geoff Clare wrote:
>>> Lawrence D’Oliveiro wrote:
>>>
>>>> On Thu, 5 Nov 2026 13:53:50 +0000, Geoff Clare wrote:
<snip>
>>> The difference, as I explained before, is that UNIX conformance
>>> requires the POSIX "XSI Option" to be supported (and others).
>>> One of the XSI requirements is that "echo -n foo" writes "-n foo"
>>> and a newline. With the built-in echo on dash (at least on Debian;
>>> I haven't tried it on macOS) it writes just "foo" (the -n suppresses
>>> the newline). This is allowed for POSIX conformance, but not for
>>> UNIX conformance.
>>>
>>> There may well be other ways that dash does not conform to UNIX
>>> (or indeed POSIX, despite Debian's claim) requirements too. I seem
>>> to remember discussions in the Austin Group about it not handling
>>> multibyte characters correctly.
>>>
>>>>> POSIX.1 does mention bash, in non-normative rationale, as I said
>>>>> before.
>>>>
<snip>
>> Linux:
>> isdev@pingvin:~$ echo foo
>> foo
>> isdev@pingvin:~$ echo -n foo
>> fooisdev@pingvin:~$
>
> This is one of the situations where it's wrong to say "Linux" and where
> calling it e.g. "GNU/Linux" would at least be better (although it'd
> *still* miss the key part here, and just get a hint of what the shell
> may be, if the "GNU" part isn't being used just to refer to such
> distributions generically).
>
> What would matter here is which shell is that and which echo is that.
Both 'bash' and '/bin/sh' (which is actually 'dash'). IIUC each has
'echo' as a builtin command. Also '/bin/echo' (which comes from
GNU coreutils) shows the same behaviour.
Supressing newline in echo is used by quite a lot of shell scripts
and the '-n' option is normal way to do this on Linux.
--
Waldek Hebisch
Technical Details
Message-ID:
<11cli6u$2u21d$1@paganini.bofh.team>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!newsfeed.bofh.team!paganini.bofh.team!not-for-mailReferences:
<11bujmd$31udl$1@dont-email.me> <11c366q$lfc1$2@dont-email.me> <6pfmrm-l8a.ln1@ID-313840.user.individual.net> <11caqn1$36bpo$2@dont-email.me> <qg3prm-ql7.ln1@ID-313840.user.individual.net> <11cdgp6$46jl$5@dont-email.me> <fcqrrm-5o6.ln1@ID-313840.user.individual.net> <11cg8q2$12d33$1@dont-email.me> <eceurm-lq4.ln1@ID-313840.user.individual.net> <11cijp9$1sunb$1@dont-email.me> <n231sm-d23.ln1@ID-313840.user.individual.net> <11ckp2g$2jqjg$2@dont-email.me> <11cl5im$2nftp$3@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: antispam@fricas.org (Waldek Hebisch)
Newsgroups: alt.folklore.computers
Subject: Re: bash on macOS
Date: Fri, 6 Nov 2026 21:52:32 -0000 (UTC)
Organization: bofh.team Usenet service
Message-ID: <11cli6u$2u21d$1@paganini.bofh.team>
References: <11bujmd$31udl$1@dont-email.me> <11c366q$lfc1$2@dont-email.me> <6pfmrm-l8a.ln1@ID-313840.user.individual.net> <11caqn1$36bpo$2@dont-email.me> <qg3prm-ql7.ln1@ID-313840.user.individual.net> <11cdgp6$46jl$5@dont-email.me> <fcqrrm-5o6.ln1@ID-313840.user.individual.net> <11cg8q2$12d33$1@dont-email.me> <eceurm-lq4.ln1@ID-313840.user.individual.net> <11cijp9$1sunb$1@dont-email.me> <n231sm-d23.ln1@ID-313840.user.individual.net> <11ckp2g$2jqjg$2@dont-email.me> <11cl5im$2nftp$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 6 Nov 2026 21:52:32 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="3082285"; mail-complaints-to="usenet@bofh.team"; posting-host="d028f9ad2fa2c51f22dbfed0d81d7daf"; posting-account="69e66f1681224ab92235b464ce7a90b6"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
X-Postfilter: Postfilter-NG 2026.10.2