http://stackoverflow.com/questions/8748831/when-do-we-need-curly-braces-in-variables-using-bash
正常情况下都可以,特殊情况下需要用花括号来区分变量名和其他的字符
http://stackoverflow.com/questions/2600281/what-is-the-difference-between-operator-and-in-bash
正常情况下都可以使用,最好使用 “==”
export (in ksh/sh):exported var is accessible by all the shells or processes invoked by the original shell (an environment value)
set (in csh): set a local variable
setenv (in csh): set an environment variable
http://www.theunixschool.com/2010/04/what-is-difference-between-export-set.html
declare is used to declare variables and give them attribute
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html
[ -a File ]
[ -d dir ]
[ -z String ]
[ -n String ]
[ Integer1 OP Interger2 ] "OP" is one of -eq, -ne, -lt, -le, -gt or -ge
test exit status:
[ $? -eq 0 ]
Regular expressions may also be used in comparisons:
if [[ "$gender" == f* ]]
http://ss64.com/bash/syntax-expand.html
http://www.tldp.org/LDP/abs/html/arithexp.html
z=$((z+3))
let z=z+3
原文:http://www.cnblogs.com/lynnge/p/5231815.html