[48384] trunk/base/src/port1.0/portutil.tcl

Rainer Müller raimue at macports.org
Fri Mar 20 10:38:46 PDT 2009


Rainer Müller wrote:
> Note this is not real sed, only a small subset is supported (lacking
> documentation). You can only do "s/foo/bar/" which replaces a single
> instance of the search pattern or "g/foo/bar/" to make the replace
> global, i.e. apply on all occurrences. It is also possible to leave out
> 's' or 'g' which behaves like 's', but can also be used for deletes like
> "/foo/". The delimiter, which is "/" above, can be chosen freely. If you
> want to play with strsed or test your replaces do what you expect, use [1].

And now what I intended to write here but replied to the wrong mail first:

Please note that & does not do here what it usually does with sed.
It will not be replaced with the matched pattern, but treated as a
regular character. It's also not possible to use other back-references
like \1 etc.

Rainer


More information about the macports-dev mailing list