-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefinecolours.sh
More file actions
45 lines (40 loc) · 1.05 KB
/
definecolours.sh
File metadata and controls
45 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File: definecolours.sh
# Created: 03/07/2014 by Matt Easton
# Modified: 20/02/2020 by Matt Easton
#
# Define colours for shell scripts.
#
# Colour definitions
# - taken from Color Bash Prompt HowTo via tldp.org
# - some colours might look different on some terminals
# - different commands for different operating systems
# Set command string for current OS
if [[ "$(uname)" == "Darwin" ]]; then
CS="\033"
else
CS="\e"
fi
## Normal Colours
Black="${CS}[0;30m" # Black
Red="${CS}[0;31m" # Red
Green="${CS}[0;32m" # Green
Yellow="${CS}[0;33m" # Yellow
Blue="${CS}[0;34m" # Blue
Purple="${CS}[0;35m" # Purple
Cyan="${CS}[0;36m" # Cyan
White="${CS}[0;37m" # White
## Bold
BBlack="${CS}[1;30m" # Black
BRed="${CS}[1;31m" # Red
BGreen="${CS}[1;32m" # Green
BYellow="${CS}[1;33m" # Yellow
BBlue="${CS}[1;34m" # Blue
BPurple="${CS}[1;35m" # Purple
BCyan="${CS}[1;36m" # Cyan
BWhite="${CS}[1;37m" # White
## Background
On_Black="${CS}[40m" # Black
On_Red="${CS}[41m" # Red
## Special
NC="${CS}[m" # Color Reset
ALERT=${BWhite}${On_Red} # Bold White on red background