How do I run a Perl one liner from a makefile? -


I know that Pearl is very simple under a liner, works and makes a global replacement, for A; But how do I run it in MessFile?

  perl -pi -e "s / a / a / g" filename  

I have tried (now I think the rest post is junk Because the shell command increases the extension of a command line - I do not want!) The question is still standing!

  $ APP = $ (shell perl -pi -e "s / a / a / g" filename)  

without the following line and without < / P>

  EXE = $ (APP)  

and I always get the following error

  create: APP: command not found  

Which I think comes from the line APP starts

thanks

If you want to run Perl as part of a target action, you can use

 $ cat Makefile all: abc | Perl -pe 's / a / a / g' $ make echo ABC | (Note that the tab character is before  echo .) 

Pearl's -

I option files in-place To edit in, but it will confuse create (unless you are writing any) Targeting from a more common pattern sources is for example:

 $ cat Makefile all: buzz: bar.in perl -pe 's / a / a / g' bar.in> bAr $ cat bar .in times $ make perl -pe 's / a / a / g' bar.in> bAr $ cat bar bAr 

If you tell us what you are trying to do, then We will be able to give you better, more useful answers.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -