Update fzf location
[dotfiles] / .bash_filters
1 #!/bin/sh
2 # my weird filters
3
4
5 containing_exactly() {
6 local=$@;
7 # grep -w "word1\|word2\|word3"
8 grep -w "$(echo $local | sed 's/ /\\|/g')";
9 }
10
11 containing2() {
12 local=$@;
13 # -w word exactly
14 # replace spaces by '\|'
15 grep "$(echo $local | sed 's/ /\\|/g')";
16 }
17
18 containing () {
19 local=$@;
20 out=$(echo $local | sed 's/ /|/');
21 awk "/$out/";
22 }
23
24 not_end_by () {
25 local by=$1;
26 # grep -v: inverse match
27 grep -v "$by$"
28 }
29
30 end_by () {
31 local by=$1;
32 grep "$by$"
33 }
34
35 begin_by () {
36 local by=$1;
37 grep "^$by";
38 }
39
40 not_begin_by () {
41 local by=$1;
42 grep -v "^$by";
43 }