Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

The shell's cd command



A couple of questions about the relationship of our sh's cd command and POSIX
(and no, I am not going to ask if we could try to support cd -L ...)

The first concerns when the cd command should print the destination
directory name (interactive shells only of course).

Our current rule is that we print if we chdir to some path different
than the one given on the command line (and not just different because
of "./" prepended)

POSIX says to print if any non-empty entry from CDPATH is used.
(And also in the "cd -" case, but we do the same there.)

These result in almost the same behaviour, except that POSIX would
print the destination directory with a CDPATH entry of ".", whereas
we don't.

Should we change that?

The cdprint option is brutal, it prints even in obvious cases like
"cd /" so it is not all that useful.  Being able to decide whether
you want "cd relative" to print, or not, by putting either "." or ""
in CDPATH seems like it might be useful.]

Second: POSIX is being changed, so that rather than
	cd ""
being implementation defined (we define it as being "cd .")
it is going to be required to be an error.  Should we make this
change now, or wait (or never do it) ?

kre



Home | Main Index | Thread Index | Old Index