This works for me in GNU sed:

sed '0,/^\#/ c My new line content goes here. Watch out for special
characters.'

Regards,
--Jim--
James S. Tison
Senior Software Engineer
Software Group/EPS Architecture
IBM Corporation



"Romanowski, John (OFT)" <[EMAIL PROTECTED]>
Sent by: Linux on 390 Port <[email protected]>
10/25/2006 03:57 PM
Please respond to
Linux on 390 Port <[email protected]>


To
[email protected]
cc

Subject
use sed or awk or ?






I want to find the first comment line that begins with a target string
in column 1 (#target) and replace only that first target line with
another string.
There are multiple lines that begin with #target.

I've struck out with sed (not that I know sed).

Any quick hints on a sed or awk or ?? sequence that does that?
--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or
otherwise legally protected. It is intended only for the addressee. If you
received this e-mail in error or from someone who was not authorized to
send it to you, do not disseminate, copy or otherwise use this e-mail or
its attachments.  Please notify the sender immediately by reply e-mail and
delete the e-mail from your system.

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or
visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to