LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what is the meaning of LS := /bin/ls? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-meaning-of-ls-%3D-bin-ls-4175487012/)

Linuxlearner122 12-05-2013 01:31 PM

what is the meaning of LS := /bin/ls?
 
Can anyone please let me know the meaning of LS := /bin/ls? Especially : in front of =, wht does this mean?

Madhu Desai 12-05-2013 02:23 PM

Its called variable substitution. It means, use value of 'LS' if set, otherwise use value '/bin/ls' and also set it to LS.

To make you understand easily, checkout this

Code:

$ VAR1="Howdy! ya fine"
$ echo ${VAR1:="Coool Baby"}
Howdy! ya fine
$ echo $VAR1
Howdy! ya fine

$ VAR2=""
$ echo ${VAR2:="Coool Baby"}
Coool Baby
$ echo $VAR2
Coool Baby


colucix 12-05-2013 02:31 PM

Well, you don't explain where did you find this line of code, but it appears the syntax of a Makefile. If this is the case you can read about the meaning of the different assigments operators here: http://www.gnu.org/software/make/man...e.html#Setting. Most likely the LS variable will be used later in the Makefile and it will be referenced as $(LS). Hope this helps.

Linuxlearner122 12-05-2013 03:05 PM

Thanks People. Yes it is from Makefile script. i will check the link for other issue.Thanks Again !!


All times are GMT -5. The time now is 01:52 AM.