diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-24 18:07:27 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-24 18:07:27 +0200 |
commit | 562812fb642fcc03a0781fa49170dbb607a90f5b (patch) | |
tree | dd5d3cb83d2db03870e6efd95b76e4bcf5c4aaa9 | |
parent | be6d5f11bd3aa8e1d6be6c71e6e7408ae859f0dd (diff) |
find: proper segmenting of terms
-rwxr-xr-x | src/password-store.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/password-store.sh b/src/password-store.sh index 657f0e5..c3824f9 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -343,9 +343,9 @@ cmd_find() { echo "Usage: $PROGRAM $COMMAND pass-names..." exit 1 fi - local terms="$*" - echo "Search Terms: $terms" - tree -C -l --noreport -P "*${terms// /*|*}*" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed 's/\.gpg$//' + IFS="," eval 'echo "Search Terms: $*"' + local terms="*$(printf '%s*|*' "$@")" + tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed 's/\.gpg$//' } cmd_grep() { |