-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcecho
More file actions
executable file
·59 lines (53 loc) · 1.31 KB
/
cecho
File metadata and controls
executable file
·59 lines (53 loc) · 1.31 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
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# ColorEcho v1.0
#
# By: Jerom van der Sar
##########################
# Unused (for now)
BBLK="\033[40m" # background black
BRED="\033[41m" # background red
BGRN="\033[42m" # background green
BYEL="\033[43m" # background yellow
BBLE="\033[44m" # background blue
BMAG="\033[45m" # background magenta
BCYN="\033[46m" # background cyan
BWHT="\033[47m" # background white
# Colors
RS="\033[0m" # reset
HC="\033[1m" # hicolor
UL="\033[4m" # underline
INV="\033[7m" # inverse background and foreground
FBLK="\033[30m" # foreground black
FRED="\033[31m" # foreground red
FGRN="\033[32m" # foreground green
FYEL="\033[33m" # foreground yellow
FBLE="\033[34m" # foreground blue
FMAG="\033[35m" # foreground magenta
FCYN="\033[36m" # foreground cyan
FWHT="\033[37m" # foreground white
if [ "$1" == "--help" ]
then
./cecho "&11 &22 &33 &44 &55 &66 &77 &r &ii&r &uu&r &hh"
exit
fi
function cecho() {
line="$*"
line="${line//'&r'/$RS}"
line="${line//'&h'/$HC}"
line="${line//'&i'/$INV}"
line="${line//'&u'/$UL}"
line="${line//'&0'/$FBLK}"
line="${line//'&1'/$FRED}"
line="${line//'&2'/$FGRN}"
line="${line//'&3'/$FYEL}"
line="${line//'&4'/$FBLE}"
line="${line//'&5'/$FMAG}"
line="${line//'&6'/$FCYN}"
line="${line//'&7'/$FWHT}"
echo -e "${line}${RS}"
}
if [ "$#" != "0" ]
then
cecho $*
fi