On Wed, Aug 31, 2016 at 01:53:30PM +0100, Theo Buehler wrote:
> 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.

I agree. Feel free to improve the error message, but please keep it accurate.

As for how I (albeit rarely) have used it:

$ pwd
/usr/src/usr.bin/ssh
$ cd src src/regress
/usr/src/regress/usr.bin/ssh
$ pwd
/usr/src/regress/usr.bin/ssh

/Alexander

Reply via email to