我寫了下面的expect腳本: /usr/bin/expect<<EOF
set SERVER_HOSTNAME "$env(SERVER_HOSTNAME)"
set USERNAME "$env(USERNAME)"
set PASSWORD "$env(PASSWORD)"
set timeout -1
spawn ssh "[email protected]$SERVER_
使用期望腳本重置服務器數據庫中的密碼時,出現以下消息。當我嘗試重置包含「!」的密碼時,我只出現此錯誤。作爲第一個字符。 [[email protected]]# ./changepw username !password!
-bash: !password!: event not found
我的腳本如下: #!/usr/bin/expect -f
## Set up variables