Skip to content

Instantly share code, notes, and snippets.

@mitchallen
Last active June 24, 2025 08:52
Show Gist options
  • Save mitchallen/21b1ec7256fb8dab4e8b05744d280df8 to your computer and use it in GitHub Desktop.
Save mitchallen/21b1ec7256fb8dab4e8b05744d280df8 to your computer and use it in GitHub Desktop.
A simple shell script
#!/bin/bash
if [ -z "$1" ]; then
echo "Hello from a shell script!"
else
echo "Hello, $1!"
fi
@mitchallen
Copy link
Author

To run this file via curl:

curl -fsSL https://gist.githubusercontent.com/mitchallen/21b1ec7256fb8dab4e8b05744d280df8/raw/run.sh | sh

@mitchallen
Copy link
Author

To pass an argument, you need to wrap it in something like bash:

bash <(curl -fsSL https://gist.githubusercontent.com/mitchallen/21b1ec7256fb8dab4e8b05744d280df8/raw/run.sh) "Alice"

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