Jim Kinney wrote:
>
> try adding a p to the end of the s///g command. This will allow the
> substitution to be (p)rinted.
>
In most cases, this will double the number of lines printed,
unless sed is started in silent mode ("--silent" option or
other switches on other versions).
I think what is needed is /y, or =, or even the G command.
It all depends on what version of sed you are using. Sed is
quite balkanized. There's actually an FAQ entry for
how to do this:
http://www.ptug.org/sed/sedfaq.htm
Read "4.6. How do I insert a newline into the RHS
of a substitution?"
There are about seven solutions, depending on what version
you have.
Interestingly, the linux man page for sed has this to
say:
[XXX FIXME: more needs to be said. At the
very least, a reference to another document which
describes what is supported should be given.]
Oy.
What OS/version of sed are you using?
--
David
">david.dagon@mindspring.com
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.