1

I'm using a script that downloads images. I am having issues while running the wget command with a variable that contains "{" and "}" characters. It transforms into "%7B" and "%7D".

Here is part of the script

wget -nd -H -p -A jpg,jpeg,png,gif -e robots=off "$url"

The "$url" contains something like "http://webpage.com/di1/dir2/{1..26}.jpg".

7
  • That's what's supposed to happen. Commented Jan 6, 2014 at 2:37
  • Sooooo .. is there a way to fix it , becouse the command runs OK if I don't run it inside a script Commented Jan 6, 2014 at 2:41
  • use for url in http://webpage.com/di1/dir2/{1..26}.jpg; do wget ... done .... you can even add an & to download in parallel Commented Jan 6, 2014 at 2:41
  • 1
    mywiki.wooledge.org/XyProblem Commented Jan 6, 2014 at 2:41
  • 1
    Brace expansion doesn't occur inside quoted strings. Commented Jan 6, 2014 at 3:50

1 Answer 1

2

I just did a Loop

for i in {1..50}
do
  wget "$url$i.jpg"
done
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.