Chapter 6. Exit and Exit Status
1、$? 是脚本中最后一个命令的退出状态。
2、!在起到否定的作用时,其后面需要一个空格,如! true
3、在!用在命令行中时,起到调动最近的历史命令的作用,例如,前面你执行过 man true,
当你执行!man时,就会调用man true.
正在关注 Linux 、开源、IT 的个人博客。
Chapter 6. Exit and Exit Status
1、$? 是脚本中最后一个命令的退出状态。
2、!在起到否定的作用时,其后面需要一个空格,如! true
3、在!用在命令行中时,起到调动最近的历史命令的作用,例如,前面你执行过 man true,
当你执行!man时,就会调用man true.
1、Example 5-2(怎么样才能显示下面这个 $escape ?)
|
2、echo -e的用法:
|
3、可是说是一些非常烦人的用法,不用去记它,平常也用不着吧。
Note The behavior of \ depends on whether it is itself escaped, quoted, or
appearing within command substitution or a here document.
|
4、\可以起到续行符的作用,文中的叙述:
The escape also provides a means of writing a multi-line command. Normally,
each separate line constitutes a different command, but an escape at the end of
a line escapes the newline character, and the command sequence continues on to
the next line.
例如:下面的dir这个命令被分成3行来写,每行一个字符:)
|
Chapter 5. Quoting
1、那个IFS是什么意思?
Example 5-1. Echoing Weird Variables
|
2、
|
(回车就显示>,永远不会出现',除非'没有在两个'之中)
Since even the escape character (\) gets a literal interpretation within single quotes, trying to enclose a single quote within single quotes will not yield the expected result.
|
3、太令人难以把握了,没有规律吗?
Of more concern is the inconsistent behavior of "\" within double quotes.
|
4、生词:
Quoting can also suppress echo's "appetite" for newlines.
Weird
discrete
I have worked over ten years, I can spend my worker vocation(vacation) from Sept 6 to Sept 15.
I don't remember I had vacation in last several years.
In these ten days, I want finish learning that Advanced Bash-Scripting Guide a time(一次onceover). And, I will bring daughter go to childgarten(幼儿园kindergarten) and back home every day.
The house will need some deployment(布置)(改动change) yet(too).
The last several days, my emotion was low. these days, I will find something make me more happy.
Write(Writing english diary is so strange for me, no enough words and enough english grammar knowledge to express my meaning.
Is writing english diary a proper thing for me? I doubt(怀疑)。
早上送去幼儿园的时候仍然要哭闹一下。
下午是她外婆和爷爷去接她,发现一个问题,孩子的教室在三楼,放学时的上楼和下楼的人相当多,很挤。现在好多学校都存在这个问题。像侄女读高中放学也是这样。挤都挤不动。
1、
http://www.linuxsir.org/main/doc/abs/HTML/untyped.html
4.3. Bash Variables Are Untyped
Example 4-4. Integer or string?
|
2、
http://www.linuxsir.org/main/doc/abs/HTML/othertypesv.html
The space allotted to the environment is limited. Creating too many environmental variables or ones that use up excessive space may cause problems.
|
3、
命令:basename(# Strips out path name info (see 'basename'))
[mdx@localhost abs-exercises]$ basename /home/mdx/abs-guide-3.7/ex15.sh
ex15.sh
4、比较:
|
5、得到最后一个参数:
|
6、待查
If a script expects a command line parameter but is invoked without one, this may cause a null variable assignment, generally an undesirable result. One way to prevent this is to append an extra character to both sides of the assignment statement using the expected positional parameter.
|
7、在Example 4-6. wh, whois domain name lookup中,域名查询的服务器是无效的,可以换成:"wh-inn" ) whois $1@whois.internic.net;;
8、生词:
positional
notch
1、echo -n的作用简单的说就是不换行,像java中的System.out.print("something");
|
结果:Values of "a" in the loop are: 7 8 9 11
2、
下面这段的“!”不懂:
|
3、``相当于$()
|
4、英语生词:
disguised
naked
trailing
1、双引号内的变量可以保留变量值当中的超过一个空格的空格:
(abs-guide-3.7/HTML/variables.html#VARSUBN)
Example 4-1. Variable assignment and substitution
|
2、可以在一行中对多个变量赋值,但是在有可能引起版本兼容性问题:
(abs-guide-3.7/HTML/variables.html#VARSUBN)
Example 4-1. Variable assignment and substitution
|
3、在没有初始化的变量上进行算术运算不是非法的,当作是"0",但是在有可能引起版本兼容性问题:
(abs-guide-3.7/HTML/variables.html#VARSUBN)
|
|
我因为分区的时候有几个分区没有指定LABEL,所以只能以设备名来装载。这样,当把硬盘从主盘换到从盘,或者从IDE0换到IDE1时,设备名就变了,这样就必须修改这个文件才能正常使用。
也不知道怎么样在已使用分区上添加LABEL?