Carregue o arquivo (certifique-se de usar o arquivo bruto, caso contrário, carregue a página HTML!) com wget usando seu URL exato e, em seguida, canalize a saída para bash :
Veja um exemplo com esclarecimentos:
wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash
Na página de manual do comando wget :
-O file --output-document=file The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If - is used as file, documents will be printed to standard output, disabling link conversion. (Use ./- to print to a file literally named -.) Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there.
Portanto, a saída para - , na verdade, grava o conteúdo dos arquivos em STDOUT e, em seguida, você simplesmente o canaliza para bash ou o shell que preferir. Se o script precisar de sudo , você precisará fazer sudo bash no final para que a linha se torne:
wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | sudo bash