Advanced Bash-Scripting Guide 开始至第三章

2010年12月20日 星期一
Revision 6.2 17 Mar 2010 Revised by: mc
'ROWANBERRY' release

下载地址: http://www.tldp.org/LDP/abs/
含单独脚本源文件: http://bash.webofcrafts.net/abs-guide-latest.tar.bz2
脚本源文件名可在 /abs-guide/index.html 后面的 List of Examples中查找,如:/abs-guide/othertypesv.html 中 Example 4-5. Positional Parameters,它的链接为:/abs-guide/othertypesv.html#EX17 它的脚本文件名即为:ex17.sh 加上可执行属性就可直接执行验证

学习环境: Ubuntu 10.10
/abs-guide/part1.html

/abs-guide/why-shell.html
1, 脚本可以联接工具, 系统命令等完成特定的任务;
2, 可以作复杂系统的原型系统;

不能用脚本的地方:
1, 产生操作图形界面(?)
2, 闭源系统

/abs-guide/special-chars.html

疑问:
1,
initial=( `cat "$startfile" | sed -e '/#/d' | tr -d '\n' |\
# Delete lines containing '#' comment character.
sed -e 's/\./\. /g' -e 's/_/_ /g'` )

2,
echo ${PATH#*:} # Parameter substitution, not a comment.
echo $(( 2#101011 )) # Base conversion, not a comment.

3,
,, ,

Lowercase conversion in parameter substitution (added in version 4 of Bash).

4,
In a different context, the ! also appears in indirect variable references.

5,
** A double asterisk can represent the exponentiation operator or extended file-match globbing.

6,
<<<

redirection used in a here string.