"cd path" strangeness

Eduardo Krell ekrell at hector.UUCP
Sun Jun 5 11:01:51 AEST 1988


In article <337 at vector.UUCP> chip at vector.UUCP (Chip Rosenthal) writes:

>Here is a wierd one.  In csh, move to some directory which doesn't have
>a "path" subdirectory.  Then type either "cd path" or "chdir path".

>The expected response would be "path: No such file or directory."  Instead,
>no message is issued, and either you stay where you were or you move to
>$path[1].  This behavior is independant of the definition of "cdpath" (or
>lack of definition).

This is documented in the man page for csh (at least in 4.3 BSD).
When everything else fails, cd checks to see whether there's an environment
variable whose name is the same as the argument you typed. If the
value of that variable is a string and starts with a "/", then it
takes that as the directory to cd to.
    
    Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

    UUCP: {ihnp4,ucbvax}!ulysses!ekrell		ARPA: ekrell at ulysses.att.com



More information about the Comp.unix.xenix mailing list