I want to use wget with variable for parameter

Viewed 352

I'am using google colaboratory and it gives me error messages

File "<ipython-input-1-41d5736708c2>", line 14 wget --no-check-certificate foo -O bar ^ SyntaxError: invalid syntax

this is my code

foo = 'https://example.com'
bar = '/tmp/' + foo.rsplit('/')[-1]
wget --no-check-certificate foo -O bar

I was read entire tutorial videos, but everyone is using wget https://example.com instead of wget (variable) is it possible to using wget with defined variable ?

1 Answers

Interpolate the variables for the command with:

!wget --no-check-certificate {foo} -O {bar}
Related