Why does curl fail in this situation? Why does curl fail in this situation? unix unix

Why does curl fail in this situation?


The & in the url is telling bash that everything before it is a command that should be run in the background. So everything after each & is interpretted as a new command to run in the background, which is why you see a bunch of bogus processes get started when you try to run your command. Try putting the url in single quotes 'http://....' to avoid bash interpretting the $ and & characters as special characters:

curl -o test.txt 'http://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?tool=portal&sendto=on&log$=seqview&db=nuccore&dopt=gilist&sort=&query_key=1&qty=12654729&filter=all'