Re: modifying text using sed
- From: "mallin.shetland" <mallin.shetland@xxxxxxx>
- Date: Sat, 17 Nov 2007 11:33:46 +0100
Ivan scrisse:
...
You are crossposting on comp.editors!
My answer to your question is on comp.editors
mallin.shetland scrisse:
Ivan scrisse:
I know this might not be appropriate for this forum,...
Why? sed stands for Stream EDitor, it is an editor, and it
derives from ed, the UNIX editor; so sed *IS* an editor.
However, if you mean you want substitute every occurence
but first _in_ _a_ _line_ GNU sed have an easy way doing this:
s/regexp/replaclement/2g
BE AWARE!
POSIX says nothing on mixing 'g' and '$number' flags so
other implementations of sed could think this flag are
incompatible or do fuzzy things.
If you mean you want substitute every occurence but first
_in_ _a_ _file_ then:
sed '0,/a/! s/a/b/' $my_file
.
- References:
- modifying text using sed
- From: Ivan
- modifying text using sed
- Prev by Date: Re: What could I do with a cluster?
- Next by Date: Re: What could I do with a cluster?
- Previous by thread: Re: modifying text using sed
- Next by thread: RAID setup during Debian lenny installation
- Index(es):
Relevant Pages
|