6

I am looking for a way to convert a string to a clean url.

For example :

 wget http://myurl.com/toto/foo bar.jpg

This is going to download http://myurl.com/toto/foo and http://bar.jpg.

I want to download http://myurl.com/toto%20bar.jpg.

I tried some flag like --restrict-file-names=ascii but without success.

I do not want a way to encode not a kind of replace one-by-one.

Any idea ?

1
  • You can try escaping the space by a backslash (\)... wget myurl.com/tot/foo\ bar.jpg
    – Ghassan
    Mar 12, 2014 at 17:53

1 Answer 1

13

Contain the URL in quotes:

wget "http://myurl.com/toto/foo bar.jpg"

This is a general way of containing strings with spaces as a single argument.

1
  • Damn ... I should think about this. Thank you.
    – aloisdg
    Mar 12, 2014 at 18:11

You must log in to answer this question.

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