Quote:
Originally Posted by jbowers
This explanation is the best that I have encountered. An example or two might help others better understand the concept.
|
Okay but just some quick ones I'am having migraine headache
For further explanations look at :
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://tldp.org/guides.html#abs
Quotation in shell (BASH)
There are two kinds of quotation marks one is
' and the other is
" They should always come in pairs say start of quotation and end of quotation else the shell will not be happy and provide a
< as a prompt (after hitting enter).
examples:
'example'
"example"
Diffrence between the two is how they esacpe special shell characters like $ * ?.
' escapes everything. So no evaluation is done. With
" everything will get expanded
example:
Code:
MYVAR='example'
MYVAR="example"
Code:
echo "MYVAR is: $MYVAR"
prints
Code:
echo 'MYVAR is: $MYVAR'
prints
Prepare to not mix up
` and
'!
` is the start of shell expansion. Everything between
`some command` will be run in a subshell. If you want that better use
$(somecommand) this is easier to distinguish.
Last one is
\ this tells the shell to escape the following character so that it's not interpreted by the shell.
example
will print
Now of to bed or to
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://tldp.org/guides.html#abs