![]() |
how do i wget a url with spaces
hello, i am trying to do two things, one is read url's from a file, then wget (download) them all.
Here is my code: Code:
url_file=/home/xmrkite/filestodownload.txt--Thanks PS. I also want to have it download the files in the txt file from random lines instead of going in order...but not knowing beforehand how long the file will be, how can i do that? The file has one filename per line, all the files being in the same directory on the webserver. |
Have you tried wrapping the URL strings in quotes?
Code:
wget -O "/home/xmrkite/$url" "http://www.website.com/ftp/$url" |
I tried that, but it doesn't work. I'm really stumped.
I had tried using ' ` and " in various arrangements, but to no avail. Any other ideas? I know the url is good cause i can copy it into firefox and get the file. So something else must be going wrong. |
The quotes work for me - did you get an error message when you tried it? Failing that, you may be able to convert the space characters to %20 (I haven't tried that here).
|
Try escaping the spaces with \ char first
|
OK, it worked fine on my ubuntu computer, but on my DSL Linux computer, it didn't work. Why they heck would this be. I just don't get it. Any other ideas???
I tried just a simple wget "http://www.website.com/file with spaces.txt" And on dsl linux, it didn't work. -Thanks |
Might run the command on each machine to get the version number.
wget --version Now check the developers site and see if there is any issues with the one that does not work right or maybe install the latest wget. Brian |
ok, i installed the gnu-utils program from the mydsl extension loader, and that solved my problem. They probably just put in a trimmed down version of the program to save space. DSL Linux is very small after all.
|
| All times are GMT -5. The time now is 06:07 PM. |