bin/169256: /bin/sh provides crummy diagnositic when cd fails

Ronald F.Guilmette rfg at
Wed Jun 20 05:50:08 UTC 2012

>Number:         169256
>Category:       bin
>Synopsis:       /bin/sh provides crummy diagnositic when cd fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 20 05:50:07 UTC 2012
>Originator:     Ronald F. Guilmette
>Release:        FreeBSD 8.3-RELEASE amd64

8.3-RELEASE amd64


If you are running /bin/sh and you try to `cd' into a non-existant directory
(or one that you are not allowed to cd into, due to permissions) then /bin/sh
gives you the following unhelpful diagnostic:

	cd: can't cd to craponarope

(Here, the the directory name "craponarope" is just used as an example.)

I checked and both csh and bash give much more helpful diagnostics when
attempting to perform the same operation, i.e. :

	No such file or directory

In my opinion, /bin/sh should provide that more helpful diagnostic.


	cd some-nonexistant-directory


I have not looked at the source, but I imagine that the fix should be
fairly trivial.

More information about the freebsd-bugs mailing list