Double Quotes (see Table C.2):

  1. Must be matched.

  2. Protects all metacharacters from interpretation except:

    1. Itself

    2. Exclamation (!) point (bash, csh)

    3. $ used for variable substitutiond.

    4. Backquotes (` ` ) for command substitution

Table C.1. Using Single Quotes and Backslashes
C Shell Bourne ShellKorn ShellTC ShellBash Shell
echo '$><%^&*' echo '$*&!><?' echo '$*&!><?' echo '$><%^&*' echo '$*&!><?'
echo 'I need $5.00!' echo 'I need $5.00!' echo 'I need $5.00!' echo 'I need $5.00!' echo 'I need $5.00!'
echo 'She cried, "Help"' echo 'She cried, "Help"' echo 'She cried, "Help"' echo 'She cried, "Help"' echo 'She cried, "Help"'
echo '\' \\echo '\' \print '\' \echo '\' \echo '\'

Table C.2. Using Double Quotes
C ShellBourne ShellKorn ShellTC ShellBash Shell
echo "Hello $LOGNAME!"echo "Hello $LOGNAME!"print "Hello $LOGNAME!"echo "Hello $LOGNAME!"echo "Hello $LOGNAME"!
echo "I don't care"echo "I don't care"print "I don't care"echo "I don't care"echo "I don't care"
echo "The date is `date`"echo "The date is `date`"print "The date is $(date)"echo "The date is `date`"echo "The date is $(date)"
echo "\\" \\echo "\\" print "\\" echo "\\" \echo "\\" \

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.50.222