Dave C wrote:
> perl -i -pe 's|\.\/|\${MPATH}\/|g'
>
> but when I put this into a make target, I can not get the character
> escaping right. The shell always ends up interpreting $MPATH as an
> empty variable.
Make is going to do variable espansion on the line first before
passing it to the shell. Meaning that you will need to escape all '$'
characters that you want passed through to the shell verbatim. Escape
them by using two dollar signs.
perl -i -pe 's|\.\/|\$${MPATH}\/|g'
For reference the make documentation says:
To substitute a variable's value, write a dollar sign followed by the
name of the variable in parentheses or braces: either `$(foo)' or
`${foo}' is a valid reference to the variable `foo'. This special
significance of `$' is why you must write `$$' to have the effect of a
single dollar sign in a file name or command.
Bob
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make