Using a ubuntu 16.04 what I do is :
.sh
script using wget https://gist.githubusercontent.com/...
.sh
file executable sudo chmod guo+x sysInit.sh
sudo ./sysInit.sh
I was wondering if it is possible to run the code directly from the web.
Would be something like: sudo ./ https://gist.githubusercontent.com/...
.
Is it possible to do that?
You can use cUrl to download and run your script. I don't think its installed by default on Ubuntu so you'll have to sudo apt-get install curl
first if you want to use it. To download and run your script with sudo just run
curl -sL https://gist.githubusercontent.com/blah.sh | sudo sh
Be warned this is very risky and not advised for security reasons. See this related question why-using-curl-sudo-sh-is-not-advised