GNU bug report logs - #78882
stty.c compilation error

Previous Next

Package: coreutils;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Mon, 23 Jun 2025 21:15:04 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-coreutils <at> gnu.org, "H. Peter Anvin" <hpa <at> zytor.com>
Subject: Re: stty.c compilation error
Date: Mon, 23 Jun 2025 23:58:36 +0200
H. Peter Anvin wrote:
> Do the shells on these systems support $'\n' constants?

Sure. Dollar-single-quote strings in sh are quote portable.

> There is also the option of simply putting a newline in the string, I 
> believe.

The best way to include a newline in a sed script is not to use a
literal newline directly, but rather to use backslash-newline,
and start a new -e argument for the second line. [1][2]

But this is, IMO, an inordinate amount of workarounds, for using
'sed' on an input file that contains a list of numbers, one per line.
It's better to put the 'sed' script in a separate file and invoke
sed with one '-f' option instead of with several '-e' options.

Another maintainable approach, which does not require a separate
file, is the simple 'while' loop in the patch that I'm proposing.

Bruno

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sed.html
[2] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Limitations-of-Usual-Tools.html








This bug report was last modified 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.