【发布时间】:2014-04-24 14:44:11
【问题描述】:
当我从命令行执行时,该命令工作正常。但是,当我从 shell 脚本执行它时会引发错误
rsync -avz -e ssh --exclude-from=rsync.file --rsync-path="sudo rsync" ostnfe/ ubuntu@mask.compute-1.amazonaws.com:/var/www/ostnfe
来自 shell 脚本的代码:
CMD='rsync -avz -e ssh --exclude-from=rsync.file --rsync-path="sudo rsync" '$1'/ ubuntu@'$AMZ':/var/www/'$2
$CMD
错误:
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
【问题讨论】:
标签: linux shell command-line