Sponsored Content
Full Discussion: Using color in scripts
Operating Systems Linux Ubuntu Using color in scripts Post 303033721 by drew77 on Wednesday 10th of April 2019 03:15:08 PM
Old 04-10-2019
Using color in scripts

This is supposed to colorize.

But it outputs this

Code:
3[0;32mFile exists.3[0m

Code:
GREEN='3[0;32m'
RED='3[0;31m'
WHITE='3[0;37m'
RESET='3[0m'
FILE="/usr/share/sounds/My_Sounds/Short_doorbell.wav"

if [ -f "$FILE" ];
then
     echo -e "${GREEN}File exists.${RESET}"
else
     echo -e "${RED}File does NOT exist.${RESET}"
     
fi

 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

2. UNIX for Beginners Questions & Answers

Text color in Linux scripts via putty

hi Folks, Can anyone help with changing the color of the words in a linux shell script? I get how to change default background etc in putty, but for some reason the text in the script has different colors for different parts of the cript. Is there a way to have one color in a linux shell... (5 Replies)
Discussion started by: jonnyd
5 Replies
vboxrc(5)						    Linux System Administration 						 vboxrc(5)

NAME
vboxrc - user config file for vbox Description Every user can save settings in ~/.vboxrc. Everything after "#" is ignored, as are empty lines. All arguments must be separated by whitespace (spaces, tabs). Arguments may not con- tain whitespace. These keywords are allowed: USERNAME PASSWORD Username and password for vboxd login. These settings are used by vbox and vboxctrl. If they are missing, you have to enter them at runtime. VOLUME Default volume for vbox. C_BACKGROUND Background color. C_STATUSBAR Color for normal text in the status bar. C_STATUSBAR_HL Color for highlighted text in the status bar. C_POWERLED_ON Color for powerled (on). C_POWERLED_OFF Color for powerled (off). C_STATUSLED_ON Color for statusled (on). C_STATUSLED_OFF Color for statusled (off). C_LIST Color for list of messages. C_LIST_SELECTED Color for selected entry in the list of messages. C_INFOTEXT Color for info texts in the message list. All color settings have the format TEXTCOLOR:BACKGROUNDCOLOR. You may not use whitespace. These colors are available for TEXTCOLOR: BLACK RED GREEN BROWN BLUE MAGENTA CYAN GRAY DARKGREY LIGHTRED LIGHTGREEN YELLOW LIGHTBLUE LIGHTMAGENTA LIGHTCYAN WHITE These colors are available for BACKGROUNDCOLOR: BLACK RED GREEN BROWN BLUE MAGENTA CYAN GREY FILES
~/.vboxrc this configuration file /usr/doc/isdnutils/examples/vboxrc an example SEE ALSO
vbox(1) AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>, for Debian GNU/Linux and isdn4linux. ISDN 4 Linux 3.1pre4 2000/09/15 vboxrc(5)
All times are GMT -4. The time now is 06:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy