
正文
shell :
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
示例一.(用作注释,占位)
#!/bin/bash
: this is single line comment: 'this is a multiline comment,
second line
end of comments'if [ "" == "" ]; then
echo "yes"
else
:
fi
示例二 清空文件
[root@node56 ~]# cat <<<"Hello" >123.txt
[root@node56 ~]# cat 123.txt
Hello
[root@node56 ~]# : >123.txt
[root@node56 ~]# cat 123.txt
[root@node56 ~]#
示例三 参数扩展
[root@node56 ~]# : ${abc:=1234}
[root@node56 ~]# echo $abc
1234




![【电子书】[职业技术] 《Linux命令行与shell脚本编程大全(第3版)》[Richard Blum][epub+mobi+azw3] 【电子书】[职业技术] 《Linux命令行与shell脚本编程大全(第3版)》[Richard Blum][epub+mobi+azw3]](https://www.04ip.com/template/qe/style/noimg/2.jpg)

