syntax:expansion:intro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
syntax:expansion:intro [2011/02/11 05:14]
thebonsai [Overview]
syntax:expansion:intro [2015/07/09 04:27]
thebonsai [Expansions and substitutions] Fixed typo, thanks Donal Heffernan
Line 10: Line 10:
 echo "​$mystring"​ echo "​$mystring"​
 </​code>​ </​code>​
-The ''​echo''​ program definitely doesn'​t care about what a shell variable is. It is Bash's job to deal with the variable. Bash **expands** the string "''​$myvar''"​ to "''​Hello world''",​ so that ''​echo''​ will only see ''​Hello world'',​ not the variable or anything else!+The ''​echo''​ program definitely doesn'​t care about what a shell variable is. It is Bash's job to deal with the variable. Bash **expands** the string "''​$mystring''"​ to "''​Hello world''",​ so that ''​echo''​ will only see ''​Hello world'',​ not the variable or anything else!
  
 After all these expansions and substitutions are done, all quotes that are not meant literally (i.e. [[syntax:​quoting | the quotes that marked contiguous words]], as part of the shell syntax) are removed from the commandline text, so the called program won't see them. This step is called **quote-removal**. After all these expansions and substitutions are done, all quotes that are not meant literally (i.e. [[syntax:​quoting | the quotes that marked contiguous words]], as part of the shell syntax) are removed from the commandline text, so the called program won't see them. This step is called **quote-removal**.
  • syntax/expansion/intro.txt
  • Last modified: 2017/03/05 18:09
  • by fgrose