Skip to content

Instantly share code, notes, and snippets.

@AlexAtkinson
Last active November 19, 2022 15:59
Show Gist options
  • Save AlexAtkinson/6accc3a7fb9b61ec488146c1cf2cf527 to your computer and use it in GitHub Desktop.
Save AlexAtkinson/6accc3a7fb9b61ec488146c1cf2cf527 to your computer and use it in GitHub Desktop.
BASH: A simple hello world script for testing the handling of remote scripts.
#!/usr/bin/env bash
# A simple hello world script for testing the handling of remote scripts.
# HINT: Hit the 'Raw' button at the top-right to get the url for this script. It changes with every edit.
# source <(curl -s <url>)
# bash <(curl -s <url>)
echo 'Hello World!'
shopt -s expand_aliases
foo=bar
alias tester='echo "Hi from the tester alias."'
@AlexAtkinson
Copy link
Author

AlexAtkinson commented Nov 19, 2022

For this script, using the RAW button and the commented instruction, you can run:

source <(curl -s https://gist.githubusercontent.com/AlexAtkinson/6accc3a7fb9b61ec488146c1cf2cf527/raw/2fed1aa424adba8cf29ed4e35644d618bee63a1a/remote-script-sourcing.sh)

or

bash <(curl -s https://gist.githubusercontent.com/AlexAtkinson/6accc3a7fb9b61ec488146c1cf2cf527/raw/2fed1aa424adba8cf29ed4e35644d618bee63a1a/remote-script-sourcing.sh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment