🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.folklore.computers
Article #909

Portability of 'echo -n' (was: Re: bash on macOS)

#909
From: Nuno Silva
Date: Sat, 07 Nov 2026 10:02
19 lines
2461 bytes
On 2026-11-07, Lawrence D’Oliveiro wrote:

> On Fri, 6 Nov 2026 21:52:32 -0000 (UTC), Waldek Hebisch wrote:
>
>> 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.
>
> As on every other *nix that uses the GNU userland utilities.
>
> I really cannot imagine anybody wanting a command environment that did
> not interpret “-n” in this way ...

It is non-standard, and that has implications for portability. However
convenient that "-n" option may be where present, is there really a
reason not to use something more portable and conformant? IEEE
1003.1-2008 suggests printf (84381–84383).

-- 
Nuno Silva
Technical Details
Message-ID: <11cmsv6$3a9pr$2@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
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> <11cli6u$2u21d$1@paganini.bofh.team> <11clrnu$3188f$1@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!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Nuno Silva <nunojsilva@invalid.invalid>
Newsgroups: alt.folklore.computers
Subject: Portability of 'echo -n' (was: Re: bash on macOS)
Date: Sat, 07 Nov 2026 10:02:14 +0000
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <11cmsv6$3a9pr$2@dont-email.me>
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>
	<11cli6u$2u21d$1@paganini.bofh.team> <11clrnu$3188f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 07 Nov 2026 10:02:14 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3483451"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19ENfetN5NVJc2h81SKnpVd"; posting-host="838597ef0e991c1668a5b2e0497932af"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:VE6nDHU6pxy2fXAtutYM8m2T0U0= sha256:DFcrnYnoTjsKizjG3uwvhrOfmhEXzfEPvdlGs/b1vQc=
	sha1:D9/QBrCXiZtP0sSmrJoH9z8hC8M= sha256:nI+zoZmejsFkDXo7H6tjqk3594NO2yIPNdmt1kR12cE=