On Wed, Aug 31, 2016 at 08:39:51AM -0400, Ted Unangst wrote:
> About ten times a day I do something like this:
> $ cd cd tedu
> ksh: cd: bad substitution
>
> What does that even mean? According to the source, but not the manual, there
> is some two argument cd syntax which substitutes something. I have never once
> tried to do this on purpose.
>
> Thus, I think the error message should be changed to be more appropriate.
> Those few power users who try to substitute paths can probably deal with the
> error message better than I can.
But the error message "too many arguments" doesn't make sense for the
two-argument cd. The two-argument cd is documented:
cd [-LP] old new
The string new is substituted for old in the current
directory,
and the shell attempts to change to the new directory.