Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: /proc slows % echo /**/*/etc/r*(/N)




On 2024-01-21 12:09, Juergen Christoffel wrote:

The heretic's solution: locate might be your friend, as it already built a
database of pathnames:

locate /etc/ | egrep -v '^/(proc|foo|bar|baz)'

Being by nature a masochistic purist, I'm trying to use zsh native code, and thanks to Mark and Bart I think this is figured out.  Strange lurking bug tho, it never showed up until I did a global search for '*/etc/r*'.

    eval "wholedisk=( $zsh_case/**/*$~1*(/N) )"

... served, tho of course it's filthy.  I'm still not quite sure why it doesn't like '/etc/r' but nevermind.  I now realize that my true friend the tilde (thanks Roman) is what was needed and if one is good, two are better:

    wholedisk=( $~zsh_case/**/*$~1*(/N) )

... so that gets me away from '/proc' and is just plain better code.






Messages sorted by: Reverse Date, Date, Thread, Author