well, just learning sed & awk
authorpatrick nsukami <ndkpatt@gmail.com>
Wed, 7 Jan 2015 19:59:10 +0000 (19:59 +0000)
committerpatrick nsukami <ndkpatt@gmail.com>
Wed, 7 Jan 2015 19:59:10 +0000 (19:59 +0000)
.bash_filters [new file with mode: 0644]
.bashrc

diff --git a/.bash_filters b/.bash_filters
new file mode 100644 (file)
index 0000000..1525707
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# my weird filters
+
+
+containing () {
+    local=$@;
+    out=$(echo $local | sed 's/ /|/');
+    awk "/$out/";
+}
+
+not_end_by () {
+    local by=$1;
+    # grep -v: inverse match
+    grep -v $by"$"
+}
+
+end_by () {
+    local by=$1;
+    grep $by"$"
+}
+
+begin_by () {
+    local by=$1;
+    grep "^"$by;
+}
+
+not_begin_by () {
+    local by=$1;
+    grep -v "^"$by
+}
diff --git a/.bashrc b/.bashrc
index 34e6507..73ade76 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -146,3 +146,7 @@ fi
 # custom bindings
 
 [[ -f ~/.bash_bind ]] && . ~/.bash_bind
+
+# custom filters
+
+[[ -f ~/.bash_filters ]] && . ~/.bash_filters