This should replace the first target: sed -e 's/^ #target\(.*\)/another string/' file > newfile
Darren On Wednesday 25 October 2006 14:57, Romanowski, John (OFT) wrote: > 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? ---------------------------------------------------------------------- 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
