Browse Source

Add grepr1(), "flat" version of grepr()

Alois Mahdal 6 years ago
parent
commit
fb66dc0584
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      dotfiles/bash/main.bashrc

+ 10
- 0
dotfiles/bash/main.bashrc View File

107
     grep --color -n --exclude-dir=".git" -e "$p" -r "$@"
107
     grep --color -n --exclude-dir=".git" -e "$p" -r "$@"
108
 }
108
 }
109
 
109
 
110
+grepr1() {
111
+    #
112
+    # Like grepr() but only list matching items in this directory
113
+    #
114
+    # Ie. list only files in current directory or names of subdirectories
115
+    # where matches were found "somewhere".
116
+    #
117
+    grepr "$@" -l | cut -d/ -f1 | uniq
118
+}
119
+
110
 greph() {
120
 greph() {
111
     #
121
     #
112
     # Grep through bash history
122
     # Grep through bash history