Browse Source

ctools simplified

master
Dirk Alders 1 year ago
parent
commit
c4f2368eac
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      .zshrc.d/__available__/ctools.zsh

+ 6
- 5
.zshrc.d/__available__/ctools.zsh View File

@@ -1,11 +1,12 @@
1
+ccat(){
2
+    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"
3
+}
4
+
1 5
 ctail(){
2
-    tail $* | 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"
6
+    tail $* | ccat"
3 7
 }
4 8
 
5 9
 cgrep(){
6
-    grep $* | 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"
10
+    grep $* | ccat"
7 11
 }
8 12
 
9
-ccat(){
10
-    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"
11
-}

Loading…
Cancel
Save