March 10, 2023 at 2:52 PM, "Theo Buehler" <t...@theobuehler.org> wrote:
> CDPATH Search path for the cd built-in command. It works the same > way as PATH for those directories not beginning with ‘/’ or > ‘.’ in cd commands. Note that if CDPATH is set and does not > contain ‘.’ or an empty path, the current directory is not > searched. > > So setting CDPATH=:/tmp or CDPATH=.:/tmp will work as expected. I am very suprised that setting the CDPATH to that will work exactly as expected (thank you alot), now checking for cwd if the given dir exists now works, however i think that is technically a workaround and not a solution. Other shells do not have this bug, such as bash, yash, mksh, ash, dash. I have not checked POSIX if this behavior should be included as well, but i beg to differ and say this should be fixed i suppose.