1

I am trying to download file using curl, but I get the following error message.

-o: command not found

My command was

curl http://lab.test.com/test/test/down.php?c=redsoul&bbs_no=236513&file_num=7061013&filename=%EC%95%84%EC%9D%B4%EC%96%B8%EB%A7%A8%2003%ED%99%94%20%28ANIMAX%201280x720%20x264%20AAC%29.SMI&size=25485 -o 'saveas.smi'

Do I have error with my command?

5
  • 1
    question does not belong here
    – N 1.1
    Oct 20, 2010 at 7:08
  • Retagged your question since your issue is with how bash escapes special characters, not with curl. Oct 20, 2010 at 7:09
  • @N, no, but kind of a little. Bash is after all a programming language, too. Oct 20, 2010 at 7:10
  • 1
    @N 1.1 // Sorry. I think it belongs to superuser.com.
    – user45326
    Oct 20, 2010 at 7:21
  • Or maybe serverfault.com? It is more of a server admin thing to muck around with scripts, right? Oct 20, 2010 at 7:27

1 Answer 1

6

Your command looks OK, but you also need to quote the URL, like so:

curl 'http://lab.test.com/test/test/down.php?c=redsoul&bbs_no=236513&file_num=7061013&filename=%EC%95%84%EC%9D%B4%EC%96%B8%EB%A7%A8%2003%ED%99%94%20%28ANIMAX%201280x720%20x264%20AAC%29.SMI&size=25485' -o 'saveas.smi'
2
  • 2
    Oh yes, with all those & characters it is wise to quote the URL.
    – eumiro
    Oct 20, 2010 at 7:14
  • 3
    What it did here was separating several commands: curl http://lab.test.com/test/test/down.php?c=redsoul, bbs_no=236513, etc. all of them are valid (variable assignments in bash)… except the last -o which follows a variable assignement and therefore is an other command
    – Benoit
    Oct 20, 2010 at 7:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .