お世話になります
シェルスクリプトで作成したsftpのプログラムをターミナルより実行すると
put の部分でエラーが出てしまいます。
#!/bin/sh PASS1=723Y6xV5Jc REMOTE_PATH=/home/public_html local_PATH=/Users/admin/Desktop/test.html expect -c " # タイムアウト値の指定 set timeout 10 spawn sftp user@www.ac.jp expect \"Are you sure you want to continue connecting (yes/no)?\" { send \"yes\n\" expect \"password:\" send \"${PASS1}\n\" expect \”sftp>\” send \"cd ${REMOTE_PATH}\n\" expect \”sftp>\” send \”put ${local_PATH}\n\" } \"password:\" { send \"${PASS1}\n\" expect \”sftp>\” send \"cd ${REMOTE_PATH}\n\" expect \”sftp>\” send \”put ${local_PATH}\n\" } interact "
これを実行すると cd の部分までは問題なく実行できるのですが、putコマンドで以下の様なエラーが出ます
sftp> usage: send [args] string
while executing
"send \”put /Users/admin/Desktop/test.html\n""
invoked from within
文字列の作成の仕方に間違いがあるようなのですが、修正の方法がわかりません
すいませんがご教授お願い致します
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。