Last active
June 12, 2020 10:44
-
-
Save justanotherdot/b551f2885efe3abcb528d27379ab4f1e 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/sh -eu | |
announce() { | |
S="$1" | |
S_LEN="$(echo $S | wc -m)" | |
TERM_WIDTH="$(tput cols)" | |
TERM_WIDTH="$(( TERM_WIDTH - 6 ))" | |
printf "===%*s%*s===\n" $(( (TERM_WIDTH + S_LEN) / 2 )) "$S" $(( (TERM_WIDTH - S_LEN) / 2 )) "" | |
} | |
announce "Examples" | |
echo "+ one" | |
echo "+ two" | |
echo "- three" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment