Skip to content

Instantly share code, notes, and snippets.

@alifhaikal88
Forked from RichardBronosky/tputdemo.sh
Created August 18, 2014 03:55
Show Gist options
  • Save alifhaikal88/a4fdcd2a4f76a2b90a42 to your computer and use it in GitHub Desktop.
Save alifhaikal88/a4fdcd2a4f76a2b90a42 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# tputdemo.sh
echo -e "\n$(tput bold) reg dim bld und tput-command$(tput sgr0)"
for i in $(seq 0 15); do
for k in sgr0 dim bold smul; do
echo -n " $(tput $k)$(tput setaf $i)Text$(tput sgr0)"
done
echo " \$(tput setaf $i)"
done
echo
echo ' Dim $(tput dim)'
echo ' Bold $(tput bold)'
echo ' Underline $(tput smul)'
echo ' Reset $(tput sgr0)'
echo -e "\n$(tput bold) bg blk wht brwht tput-command$(tput sgr0)"
for i in $(seq 0 15); do
echo -n "$(tput setab $i) Text $(tput sgr0)"
echo -n "$(tput setab $i)$(tput setaf 0)Text $(tput sgr0)"
echo -n "$(tput setab $i)$(tput setaf 7)Text $(tput sgr0)"
echo -n "$(tput setab $i)$(tput setaf 15)Text $(tput sgr0)"
echo " \$(tput setab $i)"
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment