bug#78882: stty.c compilation error

Bruno Haible via GNU coreutils Bug Reports <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Organization GNU
Message-ID <31838256.2dzg3u6YtW@nimes>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.