forked from PHLAK/Soxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat.sh
More file actions
37 lines (26 loc) · 659 Bytes
/
format.sh
File metadata and controls
37 lines (26 loc) · 659 Bytes
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
#!/usr/bin/env bash
## COLOR & STYLE VARS
########################################
BLACK='30'
RED='31'
GREEN='32'
YELLOW='33'
BLUE='34'
WHITE='37'
NONE='00'
BOLD='01'
DULL='02'
UNDERLINE='04'
## FUNCTIONS
########################################
function format {
# Get the message value
MESSAGE=${1}
# Get the color and style values
COLOR=${2:-$WHITE} # Defaults to black, if not specified.
STYLE=${3:-$NONE} # Defaults to none, if not specified.
BG=${4:-$BLACK} # Defaults to black, if not specified.
# Echo the message with specified colors
echo -e "\033[${STYLE};${COLOR}m${MESSAGE}\033[00m"
return
}