Hello,
I've been going nuts trying to figure out how to embed a
newline in sed, and the man page just doesn't mean anything to me.
What I would like is
echo abc | sed -e's,b,\n' to get
a
c
Of course, the above doesn't work and I'm looking for an
On Thu, 7 Nov 2002 15:46:25 -0500
Mathew Kanner [EMAIL PROTECTED] wrote:
Hi,
I've been going nuts trying to figure out how to embed a
newline in sed, and the man page just doesn't mean anything to me.
What I would like is
echo abc | sed -e's,b,\n' to get
a
c
How
On 11/7/02 12:46 PM, Mathew Kanner [EMAIL PROTECTED] wrote:
What I would like is
echo abc | sed -e's,b,\n' to get
a
c
A script of the form:
echo abc | sed -e 's,b,\
,'
will work if the newline is escaped with a backslash and the remainder of
the sed substitute is on the next line.
If you
How about echo abc | tr 'b' '\n' ?
tr substitutes characters only, while sed can work on arbitrary strings and
patterns. My guess is that the example was a simplified expression of a more
general requirement, in which case sed is appropriate and therefore,
echo aaabbbccc | sed -e 's,bbb,\
,'
http://www.faqs.org/faqs/editor-faq/sed/
section 4.6
on Do, Nov 07, 2002 at 03:46:25pm -0500, Mathew Kanner wrote:
Hello,
I've been going nuts trying to figure out how to embed a
newline in sed, and the man page just doesn't mean anything to me.
What I would like is
echo abc |
On Nov 07, Paul A. Scott wrote:
How about echo abc | tr 'b' '\n' ?
tr substitutes characters only, while sed can work on arbitrary strings and
patterns. My guess is that the example was a simplified expression of a more
general requirement, in which case sed is appropriate and therefore,