1

I must call a url in a cronjob, but wget excludes the second parameter from the url.
url format:

https://example.com/frontend/?ml[do]=doStuff&ml[auth]=someAuthCode

Wget excludes the second parameter, so i become "access denied"

i tried too:

https://example.com/frontend/?ml\[do\]=doStuff&ml\[auth\]=someAuthCode

-d confirms the removal

---request begin---
GET /frontend/?ml[do]=doStuffHTTP/1.1
User-Agent: Wget/1.14 (linux-gnu)
Accept: */*
Host: example.com
Connection: Keep-Alive
---request end---

How can i call the correct url with 2 get variables includes brackets?

Tobias
  • 113

1 Answers1

1

Your shell is acting on the &, which ends a command; you need to escape that too (as well as ? which like [...] is a globbing operator):

wget https://example.com/frontend/\?ml\[do\]=doStuff\&ml\[auth\]=someAuthCode

or

wget 'https://example.com/frontend/?ml[do]=doStuff&ml[auth]=someAuthCode'

See What are the shell's control and redirection operators?

Stephen Kitt
  • 434,908