about summary refs log tree commit diff
path: root/sh
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-04-28 15:02:00 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-04-28 15:02:00 -0700
commit3df339f02003353f68ccb889bb72b825810547d2 (patch)
tree2c1b7171a436f171019c5883d3f4627a699f9f8a /sh
parent26d3949bd82d9788fc786fbd911f909b36a1c70d (diff)
fix: grep use -F to interpret password as fixed string; refactor: search $HOME
Diffstat (limited to 'sh')
-rw-r--r--sh/snippets4
1 files changed, 2 insertions, 2 deletions
diff --git a/sh/snippets b/sh/snippets
index 4c96704..25e2f04 100644
--- a/sh/snippets
+++ b/sh/snippets
@@ -64,5 +64,5 @@ find "$HOME/archive/music" -type f -name '*.wav' -execdir sh -c '
 # another way is use `grep -f-` to read pattern from stdin, but it is hard to specify filenames with spaces that way, `grep ... $(find ... | printf %q ...)` somehow thinks 'a b' as two files 'a and b', e.g., This DOES NOT WORK: `pass albiononline.com | { IFS= read -r p; printf '%s' "$p";} | grep --color=auto -IR -f- $(find . -type d \( -iname '*sandbox*interactive*' -o -iname '*albion*' \) -print0 | xargs -0 printf '%q ')`, not sure why
 {
 	pass albiononline.com | { IFS= read -r p; printf '%s\0' "$p";}
-	find . -type d \( -iname '*sandbox*interactive*' -o -iname '*albion*' \) -print0
-} | xargs -0 grep --color=auto -IR
+	find "$HOME" -type d \( -iname '*sandbox*interactive*' -o -iname '*albion*' \) -print0
+} | xargs -0 grep --color=auto -IRF