Re: modifying text using sed



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

.



Relevant Pages

  • Re: modifying text using sed
    ... sed stands for Stream EDitor, it is an editor, and it ... POSIX says nothing on mixing 'g' and '$number' flags so ... If you mean you want substitute every occurence but first ... but it fails to modify the file i am attempting to ...
    (comp.editors)
  • Re: modifying text using sed
    ... sed stands for Stream EDitor, it is an editor, and it ... POSIX says nothing on mixing 'g' and '$number' flags so ... If you mean you want substitute every occurence but first ...
    (comp.editors)
  • Re: does VS C++ 2005 actually work????
    ... the parameter as UINT without giving me a list of the flags I can set or ... pretty useless, so I have to look the function up anyway, and besides, the ... (nobody at Microsoft has a clue how to write a text editor, ...
    (microsoft.public.vc.mfc)
  • Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
    ... times I ever edit in the VS editor, ... useless, because I get ... possible flags ...
    (microsoft.public.vc.mfc)