|
|||||||
|
|
3.2. Quotes and Special CharactersIf you wish to include a special character in a variable, you will have to quote it differently:
The dollar sign isn't the only character that's special to the Bash shell, but it's a simple example. An interesting step we can take to make use of assigning a variable name to another variable name is to use eval to dereference the stored variable name:
Normally, the shell does only one round of substitutions on the expression it is evaluating: if you say echo $newvar the shell will only go so far as to determine that $newvar is equal to the text string $testvar, it won't evaluate what $testvar is equal to. eval forces that evaluation. | ||||||
|
|
|
Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account Document on this page is part of "Bash Prompt HOWTO". See Index Page for more info about Authorship and Copyright. 1999-2008 Linuxinfor.com. No rights reserved. |