expect
我在使用expect 執行sed -i 的時候, 總是報錯無法執行, 請大家幫我分析下, 謝謝。具體的語句是這樣的,
expect "*#"
send "sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux\r"
提示的錯誤是這樣的
send: spawn id exp6 not open
while executing
"send "sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux\r""
(file "./test.exp" line 14)
請大家幫我看看謝謝
《解決方案》
"sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux\r"
這樣寫試試
《解決方案》
send "sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux\r"
sed命令格式不對 缺了單引號
《解決方案》
沒有spawn啊