linux的shell编程,option="${1}",什么意思,还有后面的 {0},{2}??求教啊
#!/bin/bashoption="${1}"case${option}in-f)FILE="${2}"echo"Filenameis$FILE";;-d)DIR="$...
#!/bin/bash
option="${1}"
case ${option} in
-f ) FILE="${2}"
echo "File name is $FILE "
;;
-d ) DIR="${2}"
echo "Dir name is $DIR "
;;
*)
echo "`basename ${0}`:usage: [ -f file ] | [ -d directory ] "
exit 1 #
;;
esac 展开
option="${1}"
case ${option} in
-f ) FILE="${2}"
echo "File name is $FILE "
;;
-d ) DIR="${2}"
echo "Dir name is $DIR "
;;
*)
echo "`basename ${0}`:usage: [ -f file ] | [ -d directory ] "
exit 1 #
;;
esac 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询