Created
July 7, 2020 19:01
-
-
Save kovetskiy/a4bb510595b3a6b17bfd1bd9ac8bb4a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### | |
### 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() { | |
sed -rn 's/^### ?//;T;p' "$0" | |
} | |
if [[ $# == 0 ]] || [[ "$1" == "-h" ]]; then | |
help | |
exit 1 | |
fi | |
echo Hello World |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My version, that doesn't require multiple
#
(but allows more than one if you want it for stylistic reasons):