0
我在執行他的bash腳本時遇到問題。目前,接收到意外標記'fi'附近出現語法錯誤的錯誤。 「網絡連接」。shell腳本中意外標記'fi'附近的語法錯誤sqlplus
USER_TYPE=$1 #IDENTIFY USER TYPE TYPE1,TYPE2,TYPE3,TYPE4,TYPE5
USER_NAME=$2
TARGET_SCHEMA=$3
TARGET_TABLE=$4
PERMISSION_TYPE=$5
if $USER_TYPE == 'TYPE1';
then
sqlplus/<< E00
CREATE USER ${USER_NAME}
IDENTIFIED BY "default"
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
ACCOUNT UNLOCK;
ALTER USER ${USER_NAME} DEFAULT ROLE ALL;
GRANT CREATE SESSION TO ${USER_NAME};
GRANT CONNECT TO ${USER_NAME};
exit
E00
cat perm.txt |while read PERMISSION OWNER TABLE USER
do
sqlplus/as sysdba > /home/o/direct/Passa/output/output.log << E01
GRANT $PERMISSION ON $OWNER.$TABLE TO $USER;
E01
fi
我將刪除sqlplus和Oracle標記,因爲這是一個shell腳本問題(「fi」與Oracle或sqlplus無關)。 – mathguy
修復語法。請看看:http://www.shellcheck.net/ – Cyrus