小编Jac*_*cob的帖子

Shell 脚本 - 意外标记“else”附近的语法错误

使用以下 shell 脚本,为什么会出现错误

syntax error near unexpected token `else'
Run Code Online (Sandbox Code Playgroud)

外壳脚本

echo "please enter username"
read user_name
echo "please enter password"
read -s pass
echo ${ORACLE_SID}
SID=${ORACLE_SID}
if ["${ORACLE_SID}" != 'Test'] then
sqlplus -s -l $USER_NAME/$PASS@$SID <<EOF
copy from scott/tiger@orcl insert EMP using select * from EMP
exit
EOF
else
echo "Cannot copy"
fi
Run Code Online (Sandbox Code Playgroud)

shell oracle-database shell-script

18
推荐指数
2
解决办法
10万
查看次数

标签 统计

oracle-database ×1

shell ×1

shell-script ×1