big problem with curl and bash
hi guys,
i'm here with my first question because i have big problems with downloading a file via curl + bash... downloading files via curl is easy, if i hard-code the command and press enter in the terminal. but when i put it in a script, something goes wrong and there are some errors like: "Cannot resolve host" or "http 404 - errors" i have to download the file like this: Code:
http://xxx.xxx.xxx.xxx/aspx/download.aspx?ID=xxxxxxx.xxxxx.xxx&TYPE=DOWM i have 3 files: 1) a config-file with the server-url/ip, savepath, etc. 2) a file with all functions download-function which uses curl for downloading 3) a main-bash-script the contents are: 1) config-file Code:
MYID=d9281511-6fd4-43de-851a-7e97f915da8f Code:
dwnTimetable() { Code:
#!/bin/ash Code:
xxx.xxx.xxx.xxx Code:
>HTTP Error 400. The request is badly formed. hope somebody can help me! best, holly123 |
well add a few -v's to both command lines and compare and contrast the HTTP request that is sent. If the first url works though, why are you using a completely different format in the script? If that's what you mean about the errors early on in your question, I imagine you're not escaping characters correctly or something
|
adding -v's print the header and there is an error in line 4 (the url-string is damaged)...
it should be HTTP/1.1 aspx/download.aspx?TYPE=DOWN&ID=..... i cannot explain this error! maybe someone can! Code:
* About to connect() to 194.xxx.xxx.xxx port 80 (#0) |
Problem Solved!
Thank you for your help. But my Problem was that i saved my config-File in a Windows-Format with wrong Line-Breaks... I changed to Unix/Linux-LineBreak-Format and its working fine... Damn, this mistake costs me abouts 3 hours... :D |
All times are GMT -5. The time now is 03:55 PM. |