Pārlūkot izejas kodu

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

Alois Mahdal 6 gadus atpakaļ
vecāks
revīzija
fb66dc0584
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10
    0
      dotfiles/bash/main.bashrc

+ 10
- 0
dotfiles/bash/main.bashrc Parādīt failu

@@ -107,6 +107,16 @@ grepr() {
107 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 120
 greph() {
111 121
     #
112 122
     # Grep through bash history