: ${T_INFORM:=$_INFORM} 第一个冒号的作用?
问题描述:
: ${T_INFORM:=$_INFORM} 第一个冒号的作用?
#if the user hits return on any of the fileds,the default value will be used
while :
do
echo -n "Mail Admin When Done[$_INFORM] :"
read T_INFORM
: ${T_INFORM:=$_INFORM}
case $T_INFORM in
yes|Yes) break;;
no|No) break;;
*) echo "The choices are yes,no";;
esac
done
${file:=myfile.txt}若file没设定,则使用myfile.txt作为返回值. 第一个冒号干嘛的?
答
shell不熟悉,帮不到你.
看着像是read的子语句之类的用法:
read T_INFORM :${T_INFORM:=$_INFORM}