Sorry if this seems to be a very simple command, but I have been searching for hours without any solutions and exhausted my very limited knowledge of Linux. 🙂
I need to use some command to process the following URL from a Centos Linux command line.
http://www.example.com/?sm_command=build&sm_key=kdfs7kj6dgo3sigj34df1
I have attempted to use wget and curl with various options enabled, with single quotes, and double quotes around the URL. All attempted commands pulled the home page and dropped everything from the question mark. This URL runs successfully in a browser and simply displays "DONE."
Ultimately, this will end up in a cron job that runs every so often.
Please advise me on what would be the proper syntax to complete this.
Thanks so much in advance for the assistance.
Best Answer
It should work with single quotes, if not escape the & with \&
The behavior depends on the shell you are using, so YMMV
Without quotes, bad request:
With single quotes, successful request:
Without quotes, escaped ampersand, successful request: