1525707767eaa15beaa65a51b0c9b52029a42823
[dotfiles] / .bash_filters
1 #!/bin/sh
2 # my weird filters
3
4
5 containing () {
6 local=$@;
7 out=$(echo $local | sed 's/ /|/');
8 awk "/$out/";
9 }
10
11 not_end_by () {
12 local by=$1;
13 # grep -v: inverse match
14 grep -v $by"$"
15 }
16
17 end_by () {
18 local by=$1;
19 grep $by"$"
20 }
21
22 begin_by () {
23 local by=$1;
24 grep "^"$by;
25 }
26
27 not_begin_by () {
28 local by=$1;
29 grep -v "^"$by
30 }