Hello~
If $ is inside makfile, it is considered as internal definition of makefile.
Is there any way around this?
I mean I want to print $ using makefile.
Any tip will be great help !
Hello~
If $ is inside makfile, it is considered as internal definition of makefile.
Is there any way around this?
I mean I want to print $ using makefile.
Any tip will be great help !
Not sure if I understand what you are trying to do without seeing sample program code, but putting a character inside double-quotes normally protects it from being interpreted. For instance
echo "$"
$
command.
What exactly are you trying to do?
joeyg//
Inside the makefile,
test:
awk '/MUCOEFF/{$1=0.1}1' file > file
I want to change values of MUCOEFF in file with above makefile.
0.0 MUCOEFF -> 0.1 MUCOEFF
If I type "awk '/MUCOEFF/{$1=0.1}1' file > file" in command line, it works.
But if I type "make test" which calls the above code, it gives following error message :
awk '/MUCOEFF/{=0.1}1' file > file
awk: /MUCOEFF/{=0.1}1
awk: ^ syntax error
make: *** [test] Error 1
As you see from the first line in error message, $1 is not recognized and gives syntax error.
Main reason is that $ is recognized as internal definition of makefile.
I tried "$"1 and "$1", but it does not work also.
It is recognized as "awk '/MUCOEFF/{"1=0.1}1' file > file" or "awk '/MUCOEFF/{"=0.1}1' file > file".
Any other ways?
echo "$"
won't work in a makefile because make interprets anything beginning with $ as a variable and wants to expand it, but
echo "$$"
will print a literal $, so try
test:
awk '/MUCOEFF/{$$1=0.1}1' file > file
spirtle//
Thank you so much, $$ works !!!
You have shed light on me finally.