sed s only on first matching line?
- From: "Thorne" <ego111@xxxxxxxxx>
- Date: 2 Mar 2007 20:29:55 -0800
This seems like it sould be a faq, but i can't find an answer. Is
there a reasonably simple way to do a
sed 's/foo/bar/'
such that it only operates on the first matching line it finds and
then quits.
So the file:
bob
fred
foo
joe
jim
foo
would become
bob
fred
bar
joe
jim
foo
???
Thanks for any pointers.
.
- Follow-Ups:
- Re: sed s only on first matching line?
- From: Thorne
- Re: sed s only on first matching line?
- Prev by Date: Re: (question) Corrupted production script -- how to find out
- Next by Date: Re: sed s only on first matching line?
- Previous by thread: Re: (question) Corrupted production script -- how to find out
- Next by thread: Re: sed s only on first matching line?
- Index(es):
Relevant Pages
|