From koelblandreas at freenet.de Mon Jul 18 12:17:33 2022 From: koelblandreas at freenet.de (koelblandreas at freenet.de) Date: Mon, 18 Jul 2022 14:17:33 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <20220524183507.25932-1-koelblandreas@freenet.de> References: <20220524183507.25932-1-koelblandreas@freenet.de> Message-ID: <20220718121733.18305-1-koelblandreas@freenet.de> From: Andreas K?lbl Support a computable way to find passwords. Avoid the use of additional tools. By adding the flag --flat after "pass find" it prints paths of found passwords without colors or indentions. --- src/password-store.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/password-store.sh b/src/password-store.sh index a0dcf2e..a4e84fc 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -282,8 +282,8 @@ cmd_usage() { Selectively reencrypt existing passwords using new gpg-id. $PROGRAM [ls] [subfolder] List passwords. - $PROGRAM find pass-names... - List passwords that match pass-names. ++ $PROGRAM find [--flat] pass-names... ++ List passwords that match pass-names and optionally print it without colors, indentions or special characters. $PROGRAM [show] [--clip[=line-number],-c[line-number]] pass-name Show existing password and optionally put it on the clipboard. If put on the clipboard, it will be cleared in $CLIP_TIME seconds. @@ -412,9 +412,18 @@ cmd_show() { cmd_find() { [[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..." - IFS="," eval 'echo "Search Terms: $*"' - local terms="*$(printf '%s*|*' "$@")" - tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' + local opts flat="0" + case $1 in + -f|--flat) flat=1; shift ;; + --) shift; break ;; + esac + local terms="*$(printf '%s*|*' "$@")" + if [ $flat -eq 0 ]; then + IFS="," eval 'echo "Search Terms: $*"' + tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' + else + tree -f -N -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E '/\.gpg/!d' | sed -E 's/?[?]*//g' | sed -E 's/[?]*//g' | sed -E 's/?[?]*//g' | sed -E 's/?//g' | sed -E "s|${PREFIX}/||g"| sed -E 's/\.gpg//g' | tr -d ' ' + fi } cmd_grep() { -- 2.35.1 From koelblandreas at freenet.de Mon Jul 18 12:25:07 2022 From: koelblandreas at freenet.de (koelblandreas at freenet.de) Date: Mon, 18 Jul 2022 14:25:07 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <20220528052050.32485-1-koelblandreas%40freenet.de> References: <20220528052050.32485-1-koelblandreas%40freenet.de> Message-ID: <20220718122507.20198-1-koelblandreas@freenet.de> From: Andreas K?lbl Support a computable way to find passwords. Avoid the use of additional tools. By adding the flag --flat after "pass find" it prints paths of found passwords without colors or indentions. --- src/password-store.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/password-store.sh b/src/password-store.sh index a0dcf2e..a4e84fc 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -282,8 +282,8 @@ cmd_usage() { Selectively reencrypt existing passwords using new gpg-id. $PROGRAM [ls] [subfolder] List passwords. - $PROGRAM find pass-names... - List passwords that match pass-names. ++ $PROGRAM find [--flat] pass-names... ++ List passwords that match pass-names and optionally print it without colors, indentions or special characters. $PROGRAM [show] [--clip[=line-number],-c[line-number]] pass-name Show existing password and optionally put it on the clipboard. If put on the clipboard, it will be cleared in $CLIP_TIME seconds. @@ -412,9 +412,18 @@ cmd_show() { cmd_find() { [[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..." - IFS="," eval 'echo "Search Terms: $*"' - local terms="*$(printf '%s*|*' "$@")" - tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' + local opts flat="0" + case $1 in + -f|--flat) flat=1; shift ;; + --) shift; break ;; + esac + local terms="*$(printf '%s*|*' "$@")" + if [ $flat -eq 0 ]; then + IFS="," eval 'echo "Search Terms: $*"' + tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' + else + tree -f -N -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E '/\.gpg/!d' | sed -E 's/?[?]*//g' | sed -E 's/[?]*//g' | sed -E 's/?[?]*//g' | sed -E 's/?//g' | sed -E "s|${PREFIX}/||g"| sed -E 's/\.gpg//g' | tr -d ' ' + fi } cmd_grep() { -- 2.35.1 From mem at fallback.netnod.se Tue Jul 19 09:37:50 2022 From: mem at fallback.netnod.se (Magnus Sandberg) Date: Tue, 19 Jul 2022 11:37:50 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <20220718121733.18305-1-koelblandreas@freenet.de> References: <20220524183507.25932-1-koelblandreas@freenet.de> <20220718121733.18305-1-koelblandreas@freenet.de> Message-ID: Hi, After a few minutes of manual testing at my shell prompt, I guess this one does the same; find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \ | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort Assuming that 'grep -i "${terms}"' would give the same result as 'tree ... -P "${terms%|*}" ...' Regards, // mem On 2022-07-18 at 14:17 CEST, koelblandreas at freenet.de wrote: > From: Andreas K?lbl > > Support a computable way to find passwords. Avoid the use of > additional tools. > > By adding the flag --flat after "pass find" it prints paths of found > passwords without colors or indentions. > --- > src/password-store.sh | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/src/password-store.sh b/src/password-store.sh > index a0dcf2e..a4e84fc 100755 > --- a/src/password-store.sh > +++ b/src/password-store.sh > @@ -282,8 +282,8 @@ cmd_usage() { > Selectively reencrypt existing passwords using new gpg-id. > $PROGRAM [ls] [subfolder] > List passwords. > - $PROGRAM find pass-names... > - List passwords that match pass-names. > ++ $PROGRAM find [--flat] pass-names... > ++ List passwords that match pass-names and optionally print it without colors, indentions or special characters. > $PROGRAM [show] [--clip[=line-number],-c[line-number]] pass-name > Show existing password and optionally put it on the clipboard. > If put on the clipboard, it will be cleared in $CLIP_TIME seconds. > @@ -412,9 +412,18 @@ cmd_show() { > > cmd_find() { > [[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..." > - IFS="," eval 'echo "Search Terms: $*"' > - local terms="*$(printf '%s*|*' "$@")" > - tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' > + local opts flat="0" > + case $1 in > + -f|--flat) flat=1; shift ;; > + --) shift; break ;; > + esac > + local terms="*$(printf '%s*|*' "$@")" > + if [ $flat -eq 0 ]; then > + IFS="," eval 'echo "Search Terms: $*"' > + tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' > + else > + tree -f -N -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E '/\.gpg/!d' | sed -E 's/?[?]*//g' | sed -E 's/[?]*//g' | sed -E 's/?[?]*//g' | sed -E 's/?//g' | sed -E "s|${PREFIX}/||g"| sed -E 's/\.gpg//g' | tr -d ' ' > + fi > } > > cmd_grep() { From kjetil.homme at redpill-linpro.com Tue Jul 19 10:06:23 2022 From: kjetil.homme at redpill-linpro.com (Kjetil Torgrim Homme) Date: Tue, 19 Jul 2022 12:06:23 +0200 Subject: [PATCH] Add option --flat In-Reply-To: References: <20220524183507.25932-1-koelblandreas@freenet.de> <20220718121733.18305-1-koelblandreas@freenet.de> Message-ID: <38825a52-4253-6a6b-ebd4-b3d868dcfe45@redpill-linpro.com> On 19/07/2022 11:37, Magnus Sandberg wrote: > Hi, > > After a few minutes of manual testing at my shell prompt, I guess this > one does the same; > > find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \ > ?? | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort > > > > Assuming that 'grep -i "${terms}"' would give the same result as > 'tree ... -P "${terms%|*}" ...' I would prefer a version which is not reliant on tree, too. especially since it seems very fragile to try to remove the glyphs used for the tree in the output. (in fact, on my EL7 box, the version of tree shipped with the distro is incompatible with pass, so I run find(1) manually instead!) A small point - I think it is better to remove the prefix and .gpg suffix before the grep to avoid unwanted matches (e.g., searching for "home" :) -- Kjetil T. Homme Redpill Linpro AS - Changing the game From koelblandreas at freenet.de Wed Jul 20 08:31:54 2022 From: koelblandreas at freenet.de (=?UTF-8?Q?Andreas_K=c3=b6lbl?=) Date: Wed, 20 Jul 2022 10:31:54 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <38825a52-4253-6a6b-ebd4-b3d868dcfe45@redpill-linpro.com> References: <20220524183507.25932-1-koelblandreas@freenet.de> <20220718121733.18305-1-koelblandreas@freenet.de> <38825a52-4253-6a6b-ebd4-b3d868dcfe45@redpill-linpro.com> Message-ID: <024e7679-2d9d-51c1-f08b-8e51624e43a5@freenet.de> Hello, as I'm unsure, if compatibility is the aim of the project. The commit before on this line aimed to be compatible with tree 2.0 [1]. Since find and grep is already a dependency, sure I provide a version without tree. I adapted the change, left sort out as this could be unintended use and appended suffix-removal after the first command. There are similar approaches with the aim to be POSIX-compatible [2]. Anyways, I'm unsure if they have the same wiede adoption and mass of compatible clients. But to allow different behavior here could be a compatible workaround. Any further suggestions are well appreciated. Kind Regards Andreas [1] https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09 [2] https://github.com/dylanaraps/pash Am 19.07.22 um 12:06 schrieb Kjetil Torgrim Homme: > On 19/07/2022 11:37, Magnus Sandberg wrote: >> Hi, >> >> After a few minutes of manual testing at my shell prompt, I guess >> this one does the same; >> >> find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \ >> ??? | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort >> >> >> >> Assuming that 'grep -i "${terms}"' would give the same result as >> 'tree ... -P "${terms%|*}" ...' > > I would prefer a version which is not reliant on tree, too. especially > since it seems very fragile to try to remove the glyphs used for the > tree in the output.? (in fact, on my EL7 box, the version of tree > shipped with the distro is incompatible with pass, so I run find(1) > manually instead!) > > A small point - I think it is better to remove the prefix and .gpg > suffix before the grep to avoid unwanted matches (e.g., searching for > "home" :) > -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-option-flat.patch Type: text/x-patch Size: 2167 bytes Desc: not available URL: From mem at fallback.netnod.se Wed Jul 20 09:53:18 2022 From: mem at fallback.netnod.se (Magnus Sandberg) Date: Wed, 20 Jul 2022 11:53:18 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <024e7679-2d9d-51c1-f08b-8e51624e43a5@freenet.de> References: <20220524183507.25932-1-koelblandreas@freenet.de> <20220718121733.18305-1-koelblandreas@freenet.de> <38825a52-4253-6a6b-ebd4-b3d868dcfe45@redpill-linpro.com> <024e7679-2d9d-51c1-f08b-8e51624e43a5@freenet.de> Message-ID: <3b501e26-0647-4667-cf70-430468d3174d@fallback.netnod.se> Hi Andreas, Thanks for adapting my idea, two comments; - The 'sort' command was added as 'find' list found matches in "random order" (inode order I guess). There are other places in /usr/bin/pass where 'sort' is used. I prefer sort without LC_ALL=C to not force case-sencitive sort. - I think Kjetil has a good point of removing ${PREFIX} and '.gpg' before the 'grep' to avoid "false positives" when a part of the path (not the filename) would match ${terms}. An updated version would be: find ${PREFIX} -type f -name '*.gpg' | sed -E "s|^${PREFIX}/||" \ | sed -E 's/\.gpg$//' | grep -i "${terms}" | sort Regards, // mem Den 2022-07-20 kl. 10:31, skrev Andreas K?lbl: > Hello, > > as I'm unsure, if compatibility is the aim of the project. The commit > before on this line aimed to be compatible with tree 2.0 [1]. Since find > and grep is already a dependency, sure I provide a version without tree. > I adapted the change, left sort out as this could be unintended use and > appended suffix-removal after the first command. > > There are similar approaches with the aim to be POSIX-compatible [2]. > Anyways, I'm unsure if they have the same wiede adoption and mass of > compatible clients. > > But to allow different behavior here could be a compatible workaround. > Any further suggestions are well appreciated. > > Kind Regards > Andreas > > [1] > https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09 > > [2] https://github.com/dylanaraps/pash > > Am 19.07.22 um 12:06 schrieb Kjetil Torgrim Homme: >> On 19/07/2022 11:37, Magnus Sandberg wrote: >>> Hi, >>> >>> After a few minutes of manual testing at my shell prompt, I guess >>> this one does the same; >>> >>> find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \ >>> ??? | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort >>> >>> >>> >>> Assuming that 'grep -i "${terms}"' would give the same result as >>> 'tree ... -P "${terms%|*}" ...' >> >> I would prefer a version which is not reliant on tree, too. especially >> since it seems very fragile to try to remove the glyphs used for the >> tree in the output.? (in fact, on my EL7 box, the version of tree >> shipped with the distro is incompatible with pass, so I run find(1) >> manually instead!) >> >> A small point - I think it is better to remove the prefix and .gpg >> suffix before the grep to avoid unwanted matches (e.g., searching for >> "home" :) >> From mem at fallback.netnod.se Wed Jul 20 10:15:46 2022 From: mem at fallback.netnod.se (Magnus Sandberg) Date: Wed, 20 Jul 2022 12:15:46 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <3b501e26-0647-4667-cf70-430468d3174d@fallback.netnod.se> References: <20220524183507.25932-1-koelblandreas@freenet.de> <20220718121733.18305-1-koelblandreas@freenet.de> <38825a52-4253-6a6b-ebd4-b3d868dcfe45@redpill-linpro.com> <024e7679-2d9d-51c1-f08b-8e51624e43a5@freenet.de> <3b501e26-0647-4667-cf70-430468d3174d@fallback.netnod.se> Message-ID: <90cb234f-c273-7f2f-2a8c-e8d9f7e455d5@fallback.netnod.se> Hi again, I actually revert to my first version and oppose Kjetil's second comment. After some testing I found out that 'pass find $terms' matches pathnames, too. A mix would be: find ${PREFIX} -type f -name '*.gpg' | sed -E 's/\.gpg$//' | grep -i "${terms}" | sed -E "s|^${PREFIX}/||" | sort Regards, // mem Den 2022-07-20 kl. 11:53, skrev Magnus Sandberg: > Hi Andreas, > > Thanks for adapting my idea, two comments; > > - The 'sort' command was added as 'find' list found matches in "random > order" (inode order I guess). There are other places in /usr/bin/pass > where 'sort' is used. I prefer sort without LC_ALL=C to not force > case-sencitive sort. > > - I think Kjetil has a good point of removing ${PREFIX} and '.gpg' > before the 'grep' to avoid "false positives" when a part of the path > (not the filename) would match ${terms}. > > > An updated version would be: > find ${PREFIX} -type f -name '*.gpg' | sed -E "s|^${PREFIX}/||" \ > ??? | sed -E 's/\.gpg$//' | grep -i "${terms}" | sort > > > Regards, > // mem > > > > Den 2022-07-20 kl. 10:31, skrev Andreas K?lbl: >> Hello, >> >> as I'm unsure, if compatibility is the aim of the project. The commit >> before on this line aimed to be compatible with tree 2.0 [1]. Since >> find and grep is already a dependency, sure I provide a version >> without tree. >> I adapted the change, left sort out as this could be unintended use >> and appended suffix-removal after the first command. >> >> There are similar approaches with the aim to be POSIX-compatible [2]. >> Anyways, I'm unsure if they have the same wiede adoption and mass of >> compatible clients. >> >> But to allow different behavior here could be a compatible workaround. >> Any further suggestions are well appreciated. >> >> Kind Regards >> Andreas >> >> [1] >> https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09 >> >> [2] https://github.com/dylanaraps/pash >> >> Am 19.07.22 um 12:06 schrieb Kjetil Torgrim Homme: >>> On 19/07/2022 11:37, Magnus Sandberg wrote: >>>> Hi, >>>> >>>> After a few minutes of manual testing at my shell prompt, I guess >>>> this one does the same; >>>> >>>> find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \ >>>> ??? | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort >>>> >>>> >>>> >>>> Assuming that 'grep -i "${terms}"' would give the same result as >>>> 'tree ... -P "${terms%|*}" ...' >>> >>> I would prefer a version which is not reliant on tree, too. >>> especially since it seems very fragile to try to remove the glyphs >>> used for the tree in the output.? (in fact, on my EL7 box, the >>> version of tree shipped with the distro is incompatible with pass, so >>> I run find(1) manually instead!) >>> >>> A small point - I think it is better to remove the prefix and .gpg >>> suffix before the grep to avoid unwanted matches (e.g., searching for >>> "home" :) >>> From mem at fallback.netnod.se Wed Jul 20 10:22:03 2022 From: mem at fallback.netnod.se (Magnus Sandberg) Date: Wed, 20 Jul 2022 12:22:03 +0200 Subject: [PATCH] Add option --flat In-Reply-To: <90cb234f-c273-7f2f-2a8c-e8d9f7e455d5@fallback.netnod.se> References: <20220524183507.25932-1-koelblandreas@freenet.de> <20220718121733.18305-1-koelblandreas@freenet.de> <38825a52-4253-6a6b-ebd4-b3d868dcfe45@redpill-linpro.com> <024e7679-2d9d-51c1-f08b-8e51624e43a5@freenet.de> <3b501e26-0647-4667-cf70-430468d3174d@fallback.netnod.se> <90cb234f-c273-7f2f-2a8c-e8d9f7e455d5@fallback.netnod.se> Message-ID: <652e2b64-d1aa-0468-a627-67011d6be705@fallback.netnod.se> Sorry all.... Too fast. I messed up all diffrent pathes... $PREFIX is something else than the pathes below $PREFIX. I revert back, once more, to Kjetil's comment! Sorry // mem On 2022-07-20 at 12:15 CEST, Magnus Sandberg wrote: > Hi again, > > I actually revert to my first version and oppose Kjetil's second > comment. After some testing I found out that 'pass find $terms' matches > pathnames, too. > > > A mix would be: > find ${PREFIX} -type f -name '*.gpg' | sed -E 's/\.gpg$//' | grep -i > "${terms}" | sed -E "s|^${PREFIX}/||" | sort > > > Regards, > // mem > > > > Den 2022-07-20 kl. 11:53, skrev Magnus Sandberg: >> Hi Andreas, >> >> Thanks for adapting my idea, two comments; >> >> - The 'sort' command was added as 'find' list found matches in "random >> order" (inode order I guess). There are other places in /usr/bin/pass >> where 'sort' is used. I prefer sort without LC_ALL=C to not force >> case-sencitive sort. >> >> - I think Kjetil has a good point of removing ${PREFIX} and '.gpg' >> before the 'grep' to avoid "false positives" when a part of the path >> (not the filename) would match ${terms}. >> >> >> An updated version would be: >> find ${PREFIX} -type f -name '*.gpg' | sed -E "s|^${PREFIX}/||" \ >> ???? | sed -E 's/\.gpg$//' | grep -i "${terms}" | sort >> >> >> Regards, >> // mem >> >> >> >> Den 2022-07-20 kl. 10:31, skrev Andreas K?lbl: >>> Hello, >>> >>> as I'm unsure, if compatibility is the aim of the project. The commit >>> before on this line aimed to be compatible with tree 2.0 [1]. Since >>> find and grep is already a dependency, sure I provide a version >>> without tree. >>> I adapted the change, left sort out as this could be unintended use >>> and appended suffix-removal after the first command. >>> >>> There are similar approaches with the aim to be POSIX-compatible [2]. >>> Anyways, I'm unsure if they have the same wiede adoption and mass of >>> compatible clients. >>> >>> But to allow different behavior here could be a compatible >>> workaround. Any further suggestions are well appreciated. >>> >>> Kind Regards >>> Andreas >>> >>> [1] >>> https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09 >>> >>> [2] https://github.com/dylanaraps/pash >>> >>> Am 19.07.22 um 12:06 schrieb Kjetil Torgrim Homme: >>>> On 19/07/2022 11:37, Magnus Sandberg wrote: >>>>> Hi, >>>>> >>>>> After a few minutes of manual testing at my shell prompt, I guess >>>>> this one does the same; >>>>> >>>>> find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \ >>>>> ??? | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort >>>>> >>>>> >>>>> >>>>> Assuming that 'grep -i "${terms}"' would give the same result as >>>>> 'tree ... -P "${terms%|*}" ...' >>>> >>>> I would prefer a version which is not reliant on tree, too. >>>> especially since it seems very fragile to try to remove the glyphs >>>> used for the tree in the output.? (in fact, on my EL7 box, the >>>> version of tree shipped with the distro is incompatible with pass, >>>> so I run find(1) manually instead!) >>>> >>>> A small point - I think it is better to remove the prefix and .gpg >>>> suffix before the grep to avoid unwanted matches (e.g., searching >>>> for "home" :) >>>>