Skip to content

Instantly share code, notes, and snippets.

@subicura
Created July 6, 2020 06:49
Show Gist options
  • Save subicura/0f7f33590be56cc6a18ec8bfaee61aa3 to your computer and use it in GitHub Desktop.
Save subicura/0f7f33590be56cc6a18ec8bfaee61aa3 to your computer and use it in GitHub Desktop.
shell color print
#!/bin/sh
mypad() {
printf "${text_padding+\033[${text_padding}C}"
}
mycol() {
printf "$(seq 0 7 | xargs printf "\033[${2}%sm$1")$(printf "\033[0m")"
}
printf "\n"
printf "\n"
printf "$(mypad) $(mycol '██████████ ' '0;3')\n"
printf "$(mypad) $(mycol '██████████ ' '0;3')\n"
printf "$(mypad) $(mycol '██████████ ' '0;3')\n"
printf "$(mypad) $(mycol '██████████ ' '0;3')\n"
printf "$(mypad) $(mycol '██████████ ' '0;3')\n"
printf "$(mypad) $(mycol '██████████ ' '0;3')\n"
printf "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment