% print doesnt-exist* zsh: no matches found: doesnt-exist* % print doesnt-exist*(N) (doesn't print anything, pattern is just ignored)
% print a* a-1 a-2 a-3 % print a*([-1]) a-3 % print a*([1]) a-1
So putting that together, things like this:
~/.local/share/gem/ruby/*/bin(N[-1]) # Ruby
So putting that together, things like this:
will use the latest Ruby version in ~/.local/share/gem/ruby, and it won't error out if it doesn't exist (so I can freely copy this around even to machines without Ruby, or remove Ruby, etc).