I hadn't come across the CDPATH before. I use only bash and was lamenting the absence in bash of the behaviour described for KSH without leading colon, as it would make the path superfluous, in bash, if the sought directory existed in the working directory but the first path in the CDPATH held the desired target (forcing one to type the full path to get to the next example if that was the desired destination). Happily, my bash version (5.1.4) behaves exactly as you describe for KSH so I can pick the working directory or the first CDPATH option by using or omitting ./ when the leading colon is absent from CDPATH.
Пікірлер: 2