thankcup
(thankcup)
注册会员

初级会员
UID 26979
精华
0
积分 76
帖子 69
金钱 76 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2004-3-16
状态 离线
|
帮我看看这个shell脚本有什么问题
!/bin/sh
# ifmkdir
# parameter is passed as $1 but reassigned to DIRECTORY
DIRECTORY=$1
# is the string empty ?
if [ "$DIRECTORY" = "" ];
then
echo "Usage:`basename $0` directory to create" >&2
exit 1
fi
if [ -d $DIRECTORY ];
then:
else
echo "The directory does not exist"
echo -n "Create it now ? [y..n]:"
read ANS
if [ "$ANS" = "y" ] || [ "$ANS" = "Y" ]
then
echo "creating now"
mkdir $DIRECTORY >/dev/null 2>&1
if [ $? != 0 ]; then
echo "Errors creating the directory $DIRECTORY" >&2
exit 1
fi
else:
fi
fi
|
|