소스 검색

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

Alois Mahdal 6 년 전
부모
커밋
fb66dc0584
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10
    0
      dotfiles/bash/main.bashrc

+ 10
- 0
dotfiles/bash/main.bashrc 파일 보기

@@ -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