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
RESET(7)							   SQL Commands 							  RESET(7)

NAME
RESET - restore the value of a run-time parameter to the default value SYNOPSIS
RESET configuration_parameter RESET ALL DESCRIPTION
RESET restores run-time parameters to their default values. RESET is an alternative spelling for SET configuration_parameter TO DEFAULT Refer to SET [set(7)] for details. The default value is defined as the value that the parameter would have had, if no SET had ever been issued for it in the current session. The actual source of this value might be a compiled-in default, the configuration file, command-line options, or per-database or per-user default settings. This is subtly different from defining it as ``the value that the parameter had at session start'', because if the value came from the configuration file, it will be reset to whatever is specified by the configuration file now. See in the documentation for details. The transactional behavior of RESET is the same as SET: its effects will be undone by transaction rollback. PARAMETERS
configuration_parameter Name of a settable run-time parameter. Available parameters are documented in in the documentation and on the SET [set(7)] reference page. ALL Resets all settable run-time parameters to default values. EXAMPLES
Set the timezone configuration variable to its default value: RESET timezone; COMPATIBILITY
RESET is a PostgreSQL extension. SEE ALSO
SET [set(7)], SHOW [show(7)] SQL - Language Statements 2010-05-14 RESET(7)
All times are GMT -4. The time now is 08:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy