Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cURL failing with URLs containing brackets

Tags:

curl

cURL requests fail when I pass it URLs containing brackets (for example, in the Wikipedia link below).

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `curl -g --silent --max-time 5 --location http://en.wikipedia.org/wiki/Curl_(disambiguation)'

I've been through the manual pages, but I couldn't find anything relevant. Is there any way around this?

like image 472
hauntsaninja Avatar asked Dec 27 '22 11:12

hauntsaninja


1 Answers

use double quotes:

curl -g --silent --max-time 5 --location "http://en.wikipedia.org/wiki/Curl_(disambiguation)"
like image 176
Alexander Shell Avatar answered Jan 13 '23 11:01

Alexander Shell