- 论坛徽章:
- 7
|
${A:="Y"},请问错了吗?
为什么加一个:就对了呢?不加旧错了呢?看了下面的例子,CU人都会明白^_^
:是一个相当与汇编中NOP的空语句,忽略任何参数,没有任何输出,返回值为0。
while : 等同于 while true
: >> file 等同于 tauch file
: >file 等同于 cat /dev/null >file
- r2007@www r2007 $ unset a
- r2007@www r2007 $ ${a=YES}
- -bash: YES: command not found
- r2007@www r2007 $ a=date
- r2007@www r2007 $ $a
- Thu Jan 8 22:22:28 CST 2004
- r2007@www r2007 $ a=y
- r2007@www r2007 $ $a
- -bash: y: command not found
- r2007@www r2007 $ unset a
- r2007@www r2007 $ $a
- r2007@www r2007 $ ${a=YES}
- -bash: YES: command not found
- r2007@www r2007 $
复制代码 |
|