A script that does the following:
cd "${dir}" || exit 1
would incorrectly remain in the current directory when ${dir} is
an empty string under the current implementation. This behavior,
while historical, is potentially dangerous, as it is likely not
what the script author intended.
Change the command to treat an empty string as an error and emit a
diagnostic message to standard error, as required by
IEEE Std 1003.1-2024.
PR: standards/287440