【发布时间】:2017-02-26 19:39:01
【问题描述】:
我正在尝试从以下位置复制文件:~/.ssh/ 但每次我运行脚本时它都会说
pi@raspberrypi:/etc/greenwich $ ./copybash.sh
cat: ~/.ssh/testfilegen2.log: No such file or directory
copybash.sh
!/bin/bash
sourceFile="~/.ssh/testfilegen2.log"
targetFile="/etc/network/interfaces2"
sudo cat "$sourceFile" > "$targetFile"
sudo service networking restart
有什么建议吗?
谢谢
【问题讨论】:
-
您确实需要提供更多信息,尤其是
copybash.sh脚本中的代码。 -
@Fred 包含 copybash.sh 代码
标签: linux bash quoting tilde-expansion