Last active
February 6, 2016 10:33
-
-
Save Wilfred/d22162181b00d88791a6 to your computer and use it in GitHub Desktop.
A demo of a shell script with clear coloured output
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 | |
BLACK=$(tput setaf 0) | |
BLUE=$(tput setaf 1) | |
GREEN=$(tput setaf 2) | |
CYAN=$(tput setaf 3) | |
RED=$(tput setaf 4) | |
MAGENTA=$(tput setaf 5) | |
YELLOW=$(tput setaf 6) | |
WHITE=$(tput setaf 7) | |
BOLD=$(tput bold) | |
RESET=$(tput sgr0) | |
echo -e "$BOLD$GREEN==>$WHITE Doing something $RESET" | |
echo 'Output' | |
echo 'More output.' | |
echo -e "$BOLD$GREEN==>$WHITE Doing another thing $RESET" | |
echo 'Output' | |
echo 'Yet more output.' | |
echo -e "$BOLD$GREEN==>$WHITE Summary $RESET" | |
echo 'Coloured scripts are great!' |
Author
Wilfred
commented
Jul 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment