linux script parameter $ *, $ @, etc. and double quotation marks 'single quotation marks' use `backticks effect in the script summary

#! / bin / bash 
# $ @ and $ * is not surrounded by double quotes the same effect, each parameter is independent. But the $ * when surrounded by double quotes, will all parameters as a whole. 
echo " \ $ @ and \ $ * is not surrounded by double quotes, each parameter remains independent " 
for i in  " $ @ " ; do 
 echo " \ $ @ $ i " 
DONE 

for i in $ * ;
  do echo " \ $ * $ i " 
DONE 

echo " \ $ * when surrounded by double quotes, will all parameters as a whole. " 
for i in  " $ * " ;
  do echo "\ "\ $ * \" $ I " 
DONE 

execution name # script 
echo " \ $ 0 NAME: $ 0 " 
# implementation of the script's PID 
echo " \ $$ PID: $$ " 
return value # execute a command, 0 no error 
echo " \ $ Executor the RESULT:? $ (a return value of the instruction execution, 0 means no error)? " 
# $ # is the number of parameters of the script 
echo " \ $ # the pARAMETERS: $ # " 
do_date = $ (DATE -d " -1 Day " +% F.) 
#echo   " ' "' $ do_date ' " ' " -------------- '$do_date'
echo \''$do_date'\'     -------------- '$do_date'
echo \"'$do_date'\"     -------------- "$do_date"
echo \"\''$do_date'\'\" -------------- "'$do_date'"
echo \'\"'$do_date'\"\' -------------- '"$do_date"'
echo \`'date'\`         -------------- `date`

Guess you like

Origin www.cnblogs.com/chiyizi/p/12112003.html