perl ENV value avoid escape
Posted
by Michael
on Stack Overflow
See other posts from Stack Overflow
or by Michael
Published on 2010-05-14T06:04:37Z
Indexed on
2010/05/14
6:44 UTC
Read the original article
Hit count: 274
In my makefile I have command in variable like this
substitute := perl -p -e 's/@([^@]+)@/"$(update_url)"/ge' > output.txt
update_url := em:updateURL=\"http:\/\/bla\/update.rdf\"\n
this works fine when I run command in target and I have newline, quotes
however I need to replace $(update_url)" with environment variable, using expression like this
#substitute := perl -p -e 's/@([^@]+)@/defined $$ENV{$$1} ? $$ENV{$$1} : $$1/ge'
I am exporting those variables from makefile. This gives me literally em:updateURL=\"http:\/\/bla\/update.rdf\"\n
on output file...
so how to make the second version to give output like first version?
© Stack Overflow or respective owner