Run bash script from web

wget -q -O - http://www.example.com/automation/remotescript.sh | bash /dev/stdin parameter1 parameter2
Use this command to execute the contents of http://www.example.com/automation/remotescript.sh in the local environment. The parameters are optional. Alterrnatives to wget: CURL: curl -s http://www.example.com/automation/remotescript.sh | bash /dev/stdin param1 param2 W3M: w3m -dump http://www.example.com/automation/remotescript.sh | bash /dev/stdin [param1] [param2] LYNX: lynx -source http://www.example.com/automation/remotescript.sh | bash /dev/stdin [param1] [param2]

0
By: paulera
2015-02-16 16:55:09

What Others Think

This is a colossally bad idea. Never, ever do this. Download the script first, then examine it to make sure it's not going to do anything horrible like delete the contents of your root file system or install some backdoor software. Seriously, just don't.
snegtul · 187 weeks and 4 days ago
This is a colossally bad idea. Never, ever do this. Download the script first, then examine it to make sure it's not going to do anything horrible like delete the contents of your root file system or install some backdoor software. Seriously, just don't.
snegtul · 187 weeks and 4 days ago
commandlinefu.com is broken again. Lots of 502s after logging in and/or after submitting a comment.
snegtul · 187 weeks and 4 days ago
Really, this is a horrible idea. Don't ever encourage other people to do this. I don't care how many popular GitHub projects have "curl github/blah/install.sh | sh -c" as their installation instructions. Don't do it! It's like telling a Windows user to run a random executable from example.com/hotdownloads without even running an antivirus scan on it first.
alphapapa · 183 weeks and 3 days ago
What if I do for my own scripts and automation processes, which I trust? People run installers without knowing what is their souce code and how they would affect the system, so what's the difference? I thought this site was not for beginners, and I presume people would use wisely the codes they found here.
paulera · 183 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: