The Linux expect command takes script writing to an entirely new level. Instead of automating processes, it automates running and responding to other scripts. In other words, you can write a script ...
Linuxサーバーにssh接続し、aptコマンドを実行してパッケージを更新してから、ログアウトを実行する それではシェルスクリプトと流れを紹介しよう。 9~12行目は通常のログオン処理だが、最初に変数でユーザー名やパスワード名を用いて記述を省略している。