日志正文
|
||
三、 赋值拼字符串 vi second #!/bin/sh num=2 echo “this is $numnd” echo “this is $num nd” echo “this is {$num}nd” echo “this is ${num}nd” esc :x 回车 chmod +x second ./second 输出: this is //以为找不到numnd这个变量 this is 2 nd //不用解释了吧 this is {2}nd //错误用法 this is 2nd //${num}与$num效果相同,拼字符串可以用前者 |
||
评论 想第一时间抢沙发么?