タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

expectに関するrarereのブックマーク (1)

  • expectで対話型シェル - MB blog

    sshやscpなど、対話型のインプットが必要なコマンドを、スクリプト化して運用に使いづらいので、expectパッケージを利用すると便利です。 OSにあらかじめexpectのパッケージが入っていない場合、下記コマンドでインストール。 yum install expect下記は、リモートホストにログインして ls を叩くシェルのサンプルです。 #!/bin/bash hostname=192.168.10.12 username=hoge password=hogehoge expect -c " spawn ssh -l oracle $hostname expect \"$username@$hostname's password:\" { send \"$password\n\" } \"Are you sure you want to continue connecting (yes/

    expectで対話型シェル - MB blog
  • 1