expect自動登錄scp拷貝文件無法識別通配符
只需要在spawn 後邊加上bash -c即可
#!/usr/bin/expect
spawn bash -c "scp /home/test/* [email protected]:/home/test"
expect {
"yes/no" {send "yes\r";exp_continue}
"*password" {send "123456\r"}
}
expect "100%"
expect eof
expect自動登錄scp拷貝文件無法識別通配符
只需要在spawn 後邊加上bash -c即可
#!/usr/bin/expect
spawn bash -c "scp /home/test/* [email protected]:/home/test"
expect {
"yes/no" {send "yes\r";exp_continue}
"*password" {send "123456\r"}
}
expect "100%"
expect eof
繼續運行 🥋 回憶上次內容 上上次 真寫了 萬行 代碼 這 萬行 代碼 都是寫在 明面 上的 這次 使用git命令 下載了 github上面的倉庫
一、幾個基本概念 登錄用戶(login user):通過登錄方式進入系統的用戶,強調登錄身份。 當前用戶(current user):執行一個進程或者命令時所使用的用戶身份,強調執行身份。 舉
一、幾個基本概念 tty(Teletypewriter) 來源於“電傳打印機”,Linux系統中則是終端設備的統稱,同時也代指操作系統中支持終端設備的tty子系統。 console(控制檯)