Sujet : Re: a sed question
De : rwspam (at) *nospam* gmx.de (Ralf Damaschke)
Groupes : comp.unix.shellDate : 20. Dec 2024, 01:55:04
Autres entêtes
Organisation : C.H.A.O.S.
Message-ID : <lsjtj8F2r8aU1@mid.individual.net>
References : 1 2 3
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
Salvador Mirzo wrote:
Ralf Damaschke <rwspam@gmx.de> writes:
The specification in https://pubs.opengroup.org/onlinepubs/9799919799/
That's the home page. I believe you meant to link the sed page
directly. When copying URLs from the specification, we need to copy the
framed URL, otherwise we always end up at the home page. The framed sed
page is at
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sed.html
Actually I considered that. But I felt that the top page might be of more
value since it is easy to find "Shell & Utilities" and "Utilities" in the
frames at the left, whereas the HOME link at the subframe leads to a very
detailed table of content where I would have to use the browser's find
command to locate the specs of other commands.
I tried to change a line and then append another. In both
FreeBSD's and GNU's sed, I the append takes place (and I thought they
would not if they were to obey the specification).
$ sed '/^x/{c\
hello a\
hi }' x.txt a line hello hi more lines more lines $
$ sed '/^x/{c\
hello
a\
hi
}' x.txt
For GNU sed that might be a version issue.
On my system with sed version "sed (GNU sed) 4.9" the copied&pasted
command only prints "hello" for "x" and ignores the append command.