Execute bash script from URL

source <(curl -s http://mywebsite.example/myscript.txt)

ought to do it. Alternately, leave off the initial redirection on yours, which is redirecting standard input; bash takes a filename to execute just fine without redirection, and <(command) syntax provides a path.

bash <(curl -s http://mywebsite.example/myscript.txt)

It may be clearer if you look at the output of echo <(cat /dev/null)

Leave a Comment