While writing a function to save the directory stack as a script, I noticed that ${DIRSTACK[0]}, the current directory always has the tilde unexpanded.
This is the same with bash-4.4.12 and bash-4.3.11. I was wondering if this is an oversight since DIRSTACK[0] is the same as PWD, or intentional. Having the tilde expanded for DIRSTACK[ n >= 1 ] but not 0 is an inconsistency when the rest of the array is even $'...' quoted when necessary. -- Steve Jones s...@slohj.org