commit adc4a74c26da8afa32710eca7def21e513dae8b8 parent 590961c3ec42cc6f8039ae9fbfbb886fb882b532 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Fri, 13 Nov 2020 12:47:36 +0100 list: make case-insensitive grep optional Diffstat:
M | .local/bin/list | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.local/bin/list b/.local/bin/list @@ -1,2 +1,7 @@ #!/bin/sh -grep -rnEi "$1" | grep -vE '^tags' +grepflags=-rnE +if [ "$1" = "-i" ]; then + grepflags="${grepflags}i" + shift +fi +grep "$grepflags" "$1" | grep -vE '^tags' | less -iF