Re: Solaris 10: Catching errors of builtin "cd" command in "/bin/sh"
Florian Weimer <[email protected]> Mon, 28 Jul 2025 12:07:59 +0200
| Newsgroups | gmane.comp.sysutils.autoconf.general |
|---|---|
| Message-ID | <[email protected]> |
* Paul Eggert:
> +@evindex OLDPWD
> +@evindex PWD
> +POSIX says that a successful @command{cd} updates the values of the
> +@env{OLDPWD} and @env{PWD} variables, and that @command{cd -} acts like
> +@command{cd $OLDPWD}. Older shells, such as Solaris 10
> +@command{/bin/sh}, do not support this and portable scripts should not
> +rely on it.
I think this should be @command{cd "$OLDPWD"}, to match POSIX and common
sense.
Thanks,
Florian