# fileName 文件不存在,则退出,就可以按照下面方式执行
[ -e $fileName ] || { echo -e "fileName Not existed!"; exit 1; }
#也或者可以增加一些 log 打印信息
[ -e $fileName ] && echo -e "$fileName existed" || { echo -e "$fileName Not existed!"; exit 1; }
#多个命令集合的组合
[ -e $fileName ] && echo -e "$fileName existed"; ehco -e "Other Necessary Information" || { echo -e "$fileName Not existed!"; exit 1; }
[ -e $fileName ] && { echo -e "$fileName existed"; ehco -e "Other Necessary Information"; } || { echo -e "$fileName Not existed!"; exit 1; }
#读取IP地址,若为空,则使用默认IP,否则使用新的IP地址
read -p "Please input Management IP (Default is $DEFAULT_IP): " MGMT_IP
[[ -z $MGMT_IP ]] && { MGMT_IP=$DEFAULT_IP; echo -e "Using default IP $MGMT_IP\n" ;} || DEFAULT_IP=$MGMT_IP