diff --git "a/10. Shell \345\207\275\346\225\260.md" "b/10. Shell \345\207\275\346\225\260.md" index 2514c4b..76184be 100644 --- "a/10. Shell \345\207\275\346\225\260.md" +++ "b/10. Shell \345\207\275\346\225\260.md" @@ -27,9 +27,9 @@ echo "-----function start-----" ### 输出: ``` asa@asa-virtual-machine:~$ ./printf.sh ------func start----- -This is my first shell func ------func start----- +-----function start----- +This is my first shell function +-----function start----- ``` ### 实例2(有return): ``` @@ -57,7 +57,7 @@ Input the first num1: 1 Input the second num2: 5 -Two nums are 1 and 5 ! +Two nums are 1 and 5 num1 + num2 = 6 ``` 函数返回值在调用该函数后通过 $? 来获得。 @@ -84,12 +84,12 @@ funWithParam 1 2 3 4 5 6 7 8 9 34 73 ### 输出: ``` asa@asa-virtual-machine:~$ ./printf.sh -first param is 1 -second param is 2 -tenth param is 10 -tenth param is 34 -eleventh param is 73 -Total count is 11 +The first param is 1 +The second param is 2 +The tenth param is 10 +The tenth param is 34 +The eleventh param is 73 +Total count is 11 A string of all params is 1 2 3 4 5 6 7 8 9 34 73 ``` ### 注意: @@ -104,4 +104,4 @@ $10 不能获取第十个参数,获取第十个参数需要${10}。当n>=10时 |$!| 后台运行的最后一个进程的ID号| |$@| 与$*相同,但是使用时加引号,并在引号中返回每个参数。| |$-| 显示Shell使用的当前选项,与set命令功能相同。| -|$?| 显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误。| \ No newline at end of file +|$?| 显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误。|