[plug] sed or awk

Bill Cullen billc at iinet.net.au
Mon Jan 15 21:50:42 WST 2001


> Rob Dunne wrote:
> 
> >          can anyone tell me how to replace repeated occurances of
> > that same pattern with a different replacement pattern?
> 
> > ie
> > the first  "1" is replaced with "1"
> > the second "1" is replaced with "2"
> > the third  "1" is replaced with "3"

I don't think this is what you want:

$ echo "111" | tr '111' '123'
123

Perhaps you need to give a bit more detail - perhaps a bit more 
about the nature of the input. Are these patterns on the same
line or different lines? Is each pattern made up of single or
multiple characters?

Bill
-- 
---------------------------------------------------------------------
  Bill Cullen, ENFP, billc at wantree.com.au, Perth, Western Australia
               Life's too important to take seriously.
=====================================================================



More information about the plug mailing list