On 7/16/07, Stewart Stremler <[EMAIL PROTECTED]> wrote:
begin quoting Deke Clinger as of Mon, Jul 16, 2007 at 03:51:06PM -0700:
> On Mon, 16 Jul 2007, Michael O'Keefe wrote:
>
[snip]
> > s/^.*\/\(.*\)\.dll\.so$/\1/
> > GNU sed version 4.1.5
>
> To add to what Michael said, with gnu sed you can also do something
> like:
>
> sed 's!^.*/\(.*\)\.dll\.so$!\1!'
>
> sed will automagically pick up on the first character after the 's'
> and use that as your delimiter. It doesn't buy you much here, but it
> can save you some \/ when working with long pathnames and the like.
I'm assuming that's a gnu sed extension. You can replace / with : in all
of the seds I have in reach, but not all of them will take an arbitrary
character after the s.
Well, the oldest sed man.page I have at hand (4.4BSD 1993) says
"Any character other than backslash or newline can be used instead of
a slash to delimit the RE and the replacement"
Actually that isn't the oldest reference. _The Unix System_, S.R.
Bourne 1983 says
"As in the editor _ed_, any character can be used instead of /."
Backtracking further, the 6th Edition manual page ED(I) 1973 says
"Any character other than space or new-line may be used instead of '/'
to delimit the regular expression and the replacement."
This predates sed, but pretty obviously sed was based on ed.
So there must be something wrong with some of the _sed_s you have in
reach. This feature has been documented at 10-year intervals starting
34 years ago.
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list