Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to change colors in terminal linux outputs

#!/bin/sh
RED_FG=`tput setaf 1`
GREEN_BG=`tput setab 2`
RESET=`tput sgr0`
echo "${RED_FG}${GREEN_BG}Hello world${RESET}"
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #change #colors #terminal #linux #outputs
ADD COMMENT
Topic
Name
5+4 =