I have a bash script like this:
myvar="--silent"
myurl="http://duckduckgo.com"
curl "${myvar}" "${myurl}"
This works as expected, I get the response body. Now if I want to remove the "--silent" parameter, I do this:
myvar=""
myurl="http://duckduckgo.com"
curl "${myvar}" "${myurl}"
Now the requests again works as expected, but I get this error message before the response body:
curl: (3) \<url\> malformed
If I change the script like this, then it works fine without error messages:
curl ${myvar} "${myurl}"
I would like to understand why this is happening.