[mdlug] GNU sed weirdness

Carl T. Miller carl at carltm.com
Sat Jan 23 21:24:29 EST 2010


Jeff Hanson wrote:
> without extension.  What I though was the correct form looks like
> this:
>
> sed -n 's/\(.*\)\\\(.*\)\.idx/'"\"$compress_exe\" $compress_opts
> \"$target_dir\\"'\2'".$compress_ext"'\" \"\1\\2.*\"/p' $1

I think the key part is the \1\\2 which I understand you
want to be \1 followed by a \ followed by \2.  If that's
right, it is being interpreted as \1, \\ and 2.  Try using
\1\\\2 and see it that gets the desired results.

c





More information about the mdlug mailing list