Skip to content

Instantly share code, notes, and snippets.

@wupher
Forked from kovetskiy/samizdat-shell-help.bash
Created July 16, 2021 03:26
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 wupher/42ee092f7f22a2caad958db72bf346b2 to your computer and use it in GitHub Desktop.
Save wupher/42ee092f7f22a2caad958db72bf346b2 to your computer and use it in GitHub Desktop.
#!/bin/bash
Help=$(cat <<-"HELP"
my-script — does one thing well
Usage:
my-script <input> <output>
Options:
<input> Input file to read.
<output> Output file to write. Use '-' for stdout.
-h Show this message.
HELP
)
help() {
echo "$Help"
}
if [[ $# == 0 ]] || [[ "$1" == "-h" ]]; then
help
exit 1
fi
echo Hello World
@wupher
Copy link
Author

wupher commented Jul 16, 2021

bash script to display help infomation

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