【发布时间】:2017-11-17 10:57:42
【问题描述】:
您好,我在 linux shell 中遇到了一个问题
我用expect写了一个scp脚本,脚本是这样的。
#!/bin/sh
expect -c "spawn scp /tmp/data/*2017-06-14*.log2 id@localhost:~/"\
-c "expect -re \"password\" "/
-c "sleep 1" \
-c "send \"password\r\""\
-c "interact"
执行结果显示错误信息。
/tmp/data/*2017-06-14*.log2 : No such file or directory
但是不使用expect的时候scp执行成功
[user@localhost]# scp /tmp/data/*2017-06-14*.log2 id@localhost:~/"\
我该如何解决这个问题?
【问题讨论】: