我正在尝试将一个简单的参数传递给 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