regex - Using $1 in regexp within a Makefile -


this question has answer here:

i try replace following perl command:

perl -c -p -i -e 's/([\?\.\!])\n/$1 /g' html/數14.html 

the result fine when call command line. when call within makefile doesn't work. apparently $1 interpreted shell variable.

in makefile looks this:

數14.html: 數14.adoc 40_2064_im\ strand-appartment.adoc 41_2064_ein\ plan.adoc  42_1915_in\ einer\ suppenküche.adoc      asciidoctor -d html parts/數14.adoc       perl -c -p -i -e 's/([\?\.\!])\n/$1 /g' html/數14.html 

how can have normal regexp behaviour here?

makefiles interpret $ sequences before executing commands, disregarding quoting. in order escape $ in makefile, write $$ - result in single $ in command.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -