John writes:
> 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?

  I now use Perl for this type of task.  It's straightforward to use an
anchored regular expression to match each line, and then end the program
after the first success.
--
--henry schaffer

----------------------------------------------------------------------
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