I have a simple bash script:
#!/bin/bash
wget -q 'http://requestb.in/1fq0r3s1?foo=a%2Bb' -O /dev/null
If I run this from the commandline and then inspect at http://requestb.in/1fq0r3s1?inspect I see
Query String
foo: a+b
Which is what I would expect.
However when the bash script is run by CRON, I see
Query String
foo: a b
It looks like something has decoded the URL before sending, converting the %2B
into +
which is then interpreted as a space by the receiving server.
Can anyone explain this and help me figure out how to get the script to behave in cron as it does when run from the command line?
(Note: curl
does not suffer this same behaviour, but I'm interested in learning why wget
behaves this way)