Ubuntu – Wget a script and run it

Ubuntuwget

I want to download a script from: http://dl.dropbox.com/u/11210438/flockonus-stack.sh and execute it.
My guess is, to use wget renaming it, chmod it, and execute.

What are the commands for doing that on Ubuntu?

Best Answer

Careful

Before running the script, do you trust the person who wrote it?

For example, did you expect the script to contain this?

echo "brain1" > /etc/hostname

That will try to change your hostname.


For future reference, if, after verifying the script is correct and not malicious, you can run it in one line like this:

wget -O - http://dl.dropbox.com/u/11210438/flockonus-stack.sh | bash

But download it separately and read it before running it the first time.

Also note that interactive prompts inside the downloaded script may not work properly using this method.