Hang curl command

Today, with the curl command to construct a docker api access, has not the expected results. Debugging for a long time and found that the URL is not quoted.

token=$(curl -v -XGET -H 'Authorization:Basic ××××' https://auth.docker.io/token?account=torresowen&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io)> /dev/null 2>&1

Since the URL with a bunch of parameters, parameters should lead to curl command did not read the whole.

Should the entire URL with an apostrophe, which is a shell script pitfalls, remember it

token=$(curl -v -XGET -H 'Authorization:Basic dG9ycmVzb3dlbjp3bGgxOTkyMTIyNw==' 'https://auth.docker.io/token?account=torresowen&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io')> /dev/null 2>&1

 

Guess you like

Origin www.cnblogs.com/elnino/p/11511220.html