分页: 1 / 1

[问题]请问 if [ -z "$1" ] 里面的 -z是啥意思乜?

发表于 : 2007-11-08 0:04
m_iSnow
比如下面这段脚本

if [ -z "$1" ]
then
echo "Usage: `basename $0` rpm-file"
exit $E_NOARGS
fi

经常看到在 if的[]里面有-x -z -f等符号,这些符号都是什么意思呀?
来历是什么呢?

发表于 : 2007-11-08 7:02
Wang Lei
man bash

......................

-z string
True if the length of string is zero.

-x file
True if file exists and is executable.

-f file
True if file exists and is a regular file.

发表于 : 2007-11-09 13:23
m_iSnow
ms问了一个很bc的问题
谢谢楼上
^^

发表于 : 2007-11-21 10:05
chliang315
多看看基本的教材,就知道了。

发表于 : 2007-12-11 0:04
zhyclt
-z 为空