| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
The s/// and c\ commands do not behave similarly.
With the c\ command you cannot use parts of the pattern space, like you tried. It requires a hardcoded text as a replacement for the pattern space.
And with the added quirk, that it doesn't execute anything after the c\
command :-(
---In [email protected], <n22e113@...> wrote :
Hi,Seders,
Can someone have a look (Debian 8/GUN sed 4.2.2)?
$ echo 'mail_location=mbox:~/mail:INBOX=/var/mail/%u' |\
sed -e 's/^mail_location\(.*\)$/#mail_location\1/'
#mail_location=mbox:~/mail:INBOX=/var/mail/%u
$ echo 'mail_location=mbox:~/mail:INBOX=/var/mail/%u' |\
sed -e '/^mail_location\(.*\)$/ c\#mail_location\1/'
#mail_location1/
Results are not the same with s/ & c\!
Q. What am I do wrong?
[Non-text portions of this message have been removed]