I am writing a shell script to download and install my company's MSP agent on new Mac computers that a client of ours is going to purchase. When I run the following command in the terminal it works perfectly:
curl --output AgentInstall.zip <url>
however when I put the same exact line in my script it returns the following error on running:
curl: (3) URL using bad/illegal format or missing URL
I'm not doing anything fancy like embedding the command in a variable. I've tried more variations on this then I can count, different options such as -o, -O, -oO, and others, I've tried using
$https://<url>
I've tried wrapping the URL in "", but nothing I have tried has given any sort of success. The thing that baffles me the most is that the command I posted above works when pasted directly into the terminal, but not the script. I am brand new to Shell/Bash scripting, so I'm sure it's some newbie thing that I'm missing, but if someone could point out what that is I would greatly appreciate it. Thanks!
EDIT To include Minimal Reproducible Example:
I have included my script with the URL changed to the Firefox download link. I have confirmed that once again, the command pasted into the terminal works perfectly but when run in the script it returns the above error.
#!/bin/sh
#
#download and extract agent
#
mkdir /tmp/AgentInstall
cd /tmp/AgentInstall
curl --output AgentInstall.zip https://www.mozilla.org/en-US/firefox/download/thanks/
unzip AgentInstall.zip
#