Usage of ccze for tail, journalctl and cless
This commit is contained in:
parent
bcc80df707
commit
9a01507ab5
@ -1,16 +1,25 @@
|
|||||||
ccat(){
|
TAIL_CMD=`which tail`
|
||||||
cat $* | sed -u "s/ERROR/$(tput setaf 1)&$(tput sgr0)/gI"|sed -u "s/WARNING/$(tput setaf 3)&$(tput sgr0)/gI"|sed -u "s/INFO/$(tput setaf 2)&$(tput sgr0)/gI"|sed -u "s/DEBUG/$(tput setaf 6)&$(tput sgr0)/gI"
|
JOURNALCTL_CMD=`which journalctl`
|
||||||
|
|
||||||
|
tail () {
|
||||||
|
if grep -q -i "\-f" <<< "$*"
|
||||||
|
then
|
||||||
|
$TAIL_CMD $* | ccze -A
|
||||||
|
else
|
||||||
|
$TAIL_CMD $*
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
cless(){
|
journalctl () {
|
||||||
ccat $* | less -r
|
if grep -q "\-f" <<< "$*"
|
||||||
|
then
|
||||||
|
$JOURNALCTL_CMD $* | ccze -A
|
||||||
|
else
|
||||||
|
$JOURNALCTL_CMD $*
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ctail(){
|
cless () {
|
||||||
tail $* | ccat
|
cat $1 | ccze -A | less -R
|
||||||
}
|
|
||||||
|
|
||||||
cgrep(){
|
|
||||||
grep $* | ccat
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user