Run a script directly from github

There are a lot of scripts stored on github. And you can run them directly by curling them into bash. To do so, you’ll need a link to the raw script (using the github page with the URL of the script brings in all the cruft, so you’ll need to find the raw text). To grab that, click on the page with the script and then right-click ¬†on Raw, as seen here: Screen Shot 2016-04-16 at 11.21.48 PM Then, throw out a bash command followed by < and then the URL you just copied into your clipboard in parenthesis:
bash <(curl -Ls

3 thoughts on “Run a script directly from github”

  1. Just out of curiosity, is there a reason you import the output of the curl into bash instead of piping the output to bash? Or is just personal preference?

    1. For me it’s a personal preference. Piping would look simpler. But I’d be variabalizing the script name in most cases, and prefer doing it this way when I’m doing so. Both work either way, though, so I guess it’s back to personal preference…

Comments are closed.