Skip to content

Instantly share code, notes, and snippets.

@shniranjan
Forked from mob-sakai/_README.md
Created February 26, 2022 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shniranjan/ec63f533a4c9006a7bacc6cebcec8c61 to your computer and use it in GitHub Desktop.
Save shniranjan/ec63f533a4c9006a7bacc6cebcec8c61 to your computer and use it in GitHub Desktop.
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
bash <(wget -nv -O - ${GIST_URL}) args...

# If wget-log is generated:
# https://bugs.launchpad.net/ubuntu/+source/wget/+bug/1765690
bash <(wget -o /dev/null -nv -O - ${GIST_URL}) args...

For example:

bash <(curl -sL https://gist.githubusercontent.com/mob-sakai/174a32b95572e7d8fdbf8e6f43a528f6/raw/hello.sh) I am mob-sakai!
#!/usr/bin/env bash
echo "Hello! $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment