【发布时间】:2013-08-31 18:29:44
【问题描述】:
我正在尝试将一个简单的参数传递给一个 shell 脚本。这是脚本:
if ["$1" == "d"]; then
if ["$2" == NULL]; then
echo "Please enter the local location of the files"
else
LOCAL = $2
scp -r -i ~/Dropbox/Business/aws/first.pem $LOCAL ubuntu@XX.XX.194.202:~/test/
fi
else
scp -r -i ~/Dropbox/Business/aws/first.pem ~/Dropbox/Business/aws/files/binaryhustle/ ubuntu@XX.XX.194.202:~/test/
fi
我输入:sh copyfile.sh d 我得到的错误是copyfile.sh: 1: copyfile.sh: [d: not found
【问题讨论】:
-
命令后面什么时候不用空格了?
-
抱歉,不确定您的意思?这是我的第一个 shell 脚本