shell
1#!/bin/bash 2scp ~/Library/fileA.txt id@xxx.xxx.x.x:/home/fileA.txt
というファイルを作り
sh abc password
で、実行するとうまくコピーできるのですが
パスワードを回避しようとしてexpectを使い下記のファイルを作って実行すると
shell
1#!/bin/bash 2expect -c " 3set timeout 3 4spawn "scp ~/Library/fileA.txt id@xxx.xxx.x.x:/home/fileA.txt" 5expect \"password:\" 6send \"$1\n\" 7expect \"$\" 8exit 0 9"
No such file or directoryが出て
コピーできません
~/が通らないのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/03 23:51
2017/09/04 12:00
2017/09/04 23:47