I installed msysgit 1.9.0, and added its bash utilities to
I attempted to open an HTML file with
curl. However, I got the
C:\Windows\system32\cmd.exe /c (curl 'http://www.vim.org/index.html' -o 'C:/Temp /PortableApps/gVimPortable/Data/Temp/VIA1ED5.html') curl: (1) Protocol "'http" not supported or disabled in libcurl shell returned 1 Hit any key to close this window...
In the first line of the code block,
cmd.exe with option
the command in the parenthesis
(). I copied the command inside
and ran it in
cmd.exe, and the error was reproduced.
It’s easy to find the cause of the problem. I typed “curl protocol”
on the Google search web page, and the rest of the error message
appeared in the list of suggestions. In the first search result,
which was a Stack Overflow question, I learnt why this
error occurred from the first answer—in the Command Prompt, one
needs to use double quotes
"" instead of single quotes
''. In Git
Bash, this doesn’t matter.
curl was bundled with msysgit, I suspected that the installed
version of Git was too old. I then upgraded it.
- For a shell program (e.g. Command Prompt, bash), the option
/c) stands for “command”, and what’s left is the command to be run.
curlwill grab content from the input URL and display it as standard output. To save the downloaded content in a file, the flag
-o, which means “output”, can be used.