$ ed foo << EOF > /^#target > c > whatever > . > w > q > EOF
Fargusson.Alan wrote:
I know this might not be much help, but this is the kind of thing that sed does not do. I know it can be done with awk, but since I don't know awk I usually write little C programs to do this kind of thing. -----Original Message----- From: Linux on 390 Port [mailto:[EMAIL PROTECTED] Behalf Of Romanowski, John (OFT) Sent: Wednesday, October 25, 2006 12:58 PM To: [email protected] 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
---------------------------------------------------------------------- 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
