我有这个带2个参数的shell脚本,但是运行时它会向我显示此错误。要正确编写此if-then-else块我需要做什么?
NK_BILLED_UNBILLED_DATA.sh:第31行:意外令牌else'
'K_BILLED_UNBILLED_DATA.sh: line 31:
以外的语法错误
echo Script Name: "$0"
echo Total Number of Argument Passed: "$#"
echo Arguments List -
echo 1. $2
if test -d $2;then
echo "Welcome $2"
else
echo "Not Exist";
fi
echo All Arguments are: "$*"
ORACLE_SID=BSCS01U
export ORACLE_SID
export PATH=.:$PATH:$ORACLE_HOME/bin
export BC=$1
echo "$BC"
if [ $# -ne 0 ];then
export REPORT_GEN_PATH=$2;
else
export REPORT_GEN_PATH=$WORK/Reports/ANT001A_REQ01/generated_reports;
fi
export REPORT_HOME=$BSCS_WORKDIR/Reports/ANT001A_REQ01
echo "Please wait....The Billed and Unbilled report is being created."
sqlplus SYSADM/SYSADM@$ORACLE_SID << eof_disp > $REPORT_HOME/logs/log_file_$$.log
@$REPORT_HOME/scripts/GEN_BILLED_UNBILLED_REPORT_FILE.sql
eof_disp
echo "Billed and Unbilled report created."