Results 1 to 4 of 4
Thread: Makefiles and script files
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
09-19-2005 #1
- Join Date
- May 2005
- Location
- Chennai,TamilNadu, India
- Posts
- 141
Makefiles and script files
I would like to put out something which i came across today. i dont know why it is happening like that
Suppose
path=hello
In makefiles suppose we want to print the varibale path.
It should be done in the following manner
Code:echo $(path)
if given as
Code:echo $path
It is vice versa in script files
what change does the brackets make in makefiles and script files?
or is it like take it for granted the way it is
-
09-19-2005 #2
Parentheses are used in Makefiles to reference variable names ( the exception are one-character names like 1, d, or a, which are $1, $d, and $a ).
This is just the way things are.
-
09-20-2005 #3
- Join Date
- May 2005
- Location
- Chennai,TamilNadu, India
- Posts
- 141
thanks laker
actually i was sitting with this issue by giving wihout the brackets in the makefile and wondering why it was not coming the string that was assigned to it
anyway now i can keep that in mind whenever I do something like this
-
09-20-2005 #4
- Join Date
- Feb 2005
- Posts
- 1,044
In shellscripts you use braces { } to enclose shell variables, handy if you want to append characters to variable values, eg
Code:string=myfile echo ${string}a ${string}b