From 1e92145dd492e20af8de58b58d20ab6fc11f8999 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 26 Nov 2020 14:35:14 +0100 Subject: Add cgrep function to grep in customer git repositories --- .config/bash/functions.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/bash/functions.sh b/.config/bash/functions.sh index 9f04f70..3d587e1 100644 --- a/.config/bash/functions.sh +++ b/.config/bash/functions.sh @@ -247,3 +247,8 @@ wscan() { iw $dev scan | \ sed -e '/^[^\t]/{x;p;x;}' | sed -e '/./{H;$!d;}' -e "x;/$pattern/!d;" | sed "/^$/d" } + + +cgrep() { + find ~/src/qbus/ -type d -name '.git' -exec dirname '{}' \; -exec git --no-pager --git-dir={} --work-tree={}/.. grep --full-name --color=auto "$1" \; +} -- cgit