0

I'm trying to download some data using a bash script in a Jupyter notebook and having some problems.

I added quotes to the file paths after I received a 'SyntaxError: unexpected character after line continuation character' error.

However, I'm stumped on how to fix the same error on the Wget command.

This is the contents of the cell as I have it now.

%%bash

FILE=apple2orange

URL="https\://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/$FILE.zip"
ZIP_FILE="./datasets/$FILE.zip"
TARGET_DIR="./datasets/$FILE/"
wget -N \$URL -O \$ZIP_FILE
mkdir $TARGET_DIR
unzip $ZIP_FILE -d ./datasets/
rm $ZIP_FILE
0

1 Answer 1

1

I have changed a little on your script. Now it looks like this:

%%bash

FILE=apple2orange

URL="https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/$FILE.zip"
ZIP_FILE="./datasets/$FILE.zip"
TARGET_DIR="./datasets/$FILE/"
mkdir -p $TARGET_DIR
wget -N $URL -O $ZIP_FILE
unzip $ZIP_FILE -d ./datasets/
rm $ZIP_FILE

In bash strings : doesn't need to be escaped. That was the error I think. It works on my end.

Have a try.

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.