[comp.bugs.sys5] Is this a ksh bug?

djm408@tijc02.UUCP (David Marks ) (07/19/89)

Has anybody seen the following behavior in ksh?

Assuming that the current directory is /usr/me (this does not affect the bug)

1. make a subdirectory of the current directory that contains a colon in it:
    "mkdir c:"

2. cd to that directory: "cd c:" Current directory is now /usr/me/c:

3. make a subdirectory of the current directory: "mkdir xyz"

4. cd to that directory: "cd xyz"

you should get: "ksh: xyz not found"

However, if you type cd ../c:/xyz you will have your current directory set to
/usr/me/c:/xyz with no complaints. (".." appears to mean TWO directories up
in this case!)

Now with your current directory set to /usr/me/c:/xyz type "cd ..".
Your new current directory is /usr/me! It moved you up TWO directories!

This was done on a VAX8600 running AT&T SYSTEMV Release 2.2 with the
11/16/88 ksh. ksh was the login shell and CDPATH was null.

Is this a bug? Or am I missing something in the way ksh deals with CDPATH?

This doesn't happen on our older ksh which was the version of 2/21/85.

-------------------------------------------------------------------------------
 #include <standard/disclaimer.h>  |  LIFE IS NOT A MALFUNCTION! - Number 5 
    ____  ___ _  _  __ ____     ____    _ _  ___  ___   _ _   ____
    /  / /  /  | /  /  /  /      /     //// /  / /  /   / /  /___
   /  / /--/   |/  /  /  /   /  /     /  / /--/ /--\   / \      /
  ~~~~ ~  ~    ~  ~~ ~~~~    ~~~  ~  ~  ~ ~  ~ ~   ~  ~  ~  ~~~~
Pony Express:                      |    Electric Avenue:
=============                      |    ================
David J. Marks                     |    ...!mcnc!rti!tijc02!djm408
M/S 3520                           |
Texas Instruments                  |    Ma Bell:
Erwin Highway/P. O. Drawer 1255    |    ========
Johnson City, TN. 37605            |    615-461-2074

kent@ssbell.UUCP (Kent Landfield) (07/20/89)

In article <554@tijc02.UUCP> djm408@tijc02.UUCP (David Marks         ) writes:

  [deleted text describing bug duplication steps]

>This was done on a VAX8600 running AT&T SYSTEMV Release 2.2 with the
>11/16/88 ksh. ksh was the login shell and CDPATH was null.
>
>This doesn't happen on our older ksh which was the version of 2/21/85.

This does not happen on a VAX750 running AT&T SYSTEMV Release 2.2 with the
/bin/ksh: Version 06/03/86a either.
			
			-Kent+
---
Kent Landfield               UUCP:     kent@ssbell
Sterling Software FSG/IMD    INTERNET: kent@ssbell.uu.net
1404 Ft. Crook Rd. South     Phone:    (402) 291-8300 
Bellevue, NE. 68005-2969     FAX:      (402) 291-4362

debra@alice.UUCP (Paul De Bra) (07/20/89)

In article <554@tijc02.UUCP> djm408@tijc02.UUCP (David Marks         ) writes:
}Has anybody seen the following behavior in ksh?
}
}Assuming that the current directory is /usr/me (this does not affect the bug)
}
}1. make a subdirectory of the current directory that contains a colon in it:
}    "mkdir c:"
}
}2. cd to that directory: "cd c:" Current directory is now /usr/me/c:
}
}3. make a subdirectory of the current directory: "mkdir xyz"
}
}4. cd to that directory: "cd xyz"
}
}you should get: "ksh: xyz not found"
}...
Yep, happens here too.
Don't know what causes it. I can make a guess of course.
It looks like names starting with 'something:' are interpreted as
meaning go to machine 'something'... (just a guess).

My machine is a Microvax II running the ninth edition Unix.
The ksh was taken from "alice" and is dated February 29, 1989.

Paul.

-- 
------------------------------------------------------
|debra@research.att.com   | uunet!research!debra     |
------------------------------------------------------

ekrell@hector.UUCP (Eduardo Krell) (07/21/89)

I couldn't reproduce that problem on our systems:

Vax 8650 running 4.3BSD+NFS
Sun 3s and 4s unning SunOS 4.0.3

all running the latest ksh.
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell@ulysses.att.com

tjb@Apple.COM (Tom Barrett) (07/21/89)

In article <554@tijc02.UUCP> djm408@tijc02.UUCP (David Marks         ) writes:
>Has anybody seen the following behavior in ksh?
>...
>
>you should get: "ksh: xyz not found"
>

I am not sure what you mean by "you should get" here -- I get no message.

>However, if you type cd ../c:/xyz you will have your current directory set to
>/usr/me/c:/xyz with no complaints. (".." appears to mean TWO directories up
>in this case!)
>
>Now with your current directory set to /usr/me/c:/xyz type "cd ..".
>Your new current directory is /usr/me! It moved you up TWO directories!
>...
>
>Is this a bug? Or am I missing something in the way ksh deals with CDPATH?
>
>This doesn't happen on our older ksh which was the version of 2/21/85.
>
No problem on a Mac II running A/UX.  Our ksh is the 06/03/86a version.
BTW, I also tried using a blank CDPATH -- same result.
-
Tom Barrett  (408) 974-3364
Apple Computer MS 58B 10440 Bubb Road, Cupertino CA 95014
{amdahl,decwrl,hplabs,sun,voder,nsc,mtxinu,dual,unisoft}!apple!tjb
	OR tjb@apple.com

r4@cbnews.ATT.COM (richard.r.grady..jr) (07/22/89)

In article <554@tijc02.UUCP> djm408@tijc02.UUCP (David Marks         ) writes:
* Has anybody seen the following behavior in ksh?
* 
* Assuming that the current directory is /usr/me (this does not affect the bug)
* 
* 1. make a subdirectory of the current directory that contains a colon in it:
*     "mkdir c:"
* 
* 2. cd to that directory: "cd c:" Current directory is now /usr/me/c:
* 
* 3. make a subdirectory of the current directory: "mkdir xyz"
* 
* 4. cd to that directory: "cd xyz"
* 
* you should get: "ksh: xyz not found"
* 
* However, if you type cd ../c:/xyz you will have your current directory set to
* /usr/me/c:/xyz with no complaints. (".." appears to mean TWO directories up
* in this case!)
* 
* Now with your current directory set to /usr/me/c:/xyz type "cd ..".
* Your new current directory is /usr/me! It moved you up TWO directories!
* 
* This was done on a VAX8600 running AT&T SYSTEMV Release 2.2 with the
* 11/16/88 ksh. ksh was the login shell and CDPATH was null.
* 
* Is this a bug? Or am I missing something in the way ksh deals with CDPATH?
* 
* This doesn't happen on our older ksh which was the version of 2/21/85.

I tried this on two systems:

1.   Ksh:      11/16/88
     Unix:     SV Rel 3.1.1
     Hardware: 3B2

     This had the problem.  The "cd" command behaved as in the above message.

2.   Ksh:      06/03/86a
     Unix:     SV Rel 2.0.3a
     Hardware: VAX

     This did not show the problem.  The "cd" command worked normally.

-------------------------------------------------------------------
Dick Grady               r4@mvuxd.att.com          ...!att!mvuxd!r4 

levy@cbnewsc.ATT.COM (Daniel R. Levy) (07/22/89)

In article <9648@alice.UUCP>, debra@alice.UUCP (Paul De Bra) writes:
< }1. make a subdirectory of the current directory that contains a colon in it:
< }    "mkdir c:"
< }2. cd to that directory: "cd c:" Current directory is now /usr/me/c:
< }3. make a subdirectory of the current directory: "mkdir xyz"
< }4. cd to that directory: "cd xyz"
< }you should get: "ksh: xyz not found"
< Yep, happens here too.
< My machine is a Microvax II running the ninth edition Unix.
< The ksh was taken from "alice" and is dated February 29, 1989.

I was one of the beta testers for the '88 ksh, and to the best of my memory,
this bug is in the 11/16/88 ksh, but not in the 11/16/88a ksh or earlier '86
ksh.  To see what version of ksh you have, type

	EDITOR=emacs

then type control-V.  AT&T employees can get the 88a ksh source from Korn.
-- 
Daniel R. Levy             UNIX(R) mail:  att!ttbcad!levy, att!cbnewsc!levy
AT&T Bell Laboratories
5555 West Touhy Avenue     Any opinions expressed in the message above are
Skokie, Illinois  60077    mine, and not necessarily AT&T's.

raj@cbnewsl.ATT.COM (Richard A. Johnson) (07/26/89)

In article <1925@cbnewsc.ATT.COM>, levy@cbnewsc.ATT.COM (Daniel R. Levy) writes:
> 
> I was one of the beta testers for the '88 ksh, and to the best of my memory,
> this bug is in the 11/16/88 ksh, but not in the 11/16/88a ksh or earlier '86
> ksh.
> 
> Daniel R. Levy             UNIX(R) mail:  att!ttbcad!levy, att!cbnewsc!levy

I was also a beta-tester and am now running ksh version 11/16/88a.
The bug does appear on my 3B2 running SVR3.1, and can be reproduced
as follows (in case there is still a question about what the bug is):

	$ CDPATH=/usr:/usr/raj
	$ export CDPATH
	$ cd /usr/raj
	$ mkdir c:
	$ cd c:
	$ mkdir xyz
	$ cd xyz
	ksh: xyz:  not found
	$

Rich Johnson
AT&T-BL, Whippany, NJ, att!video!raj

dwd@cbnewsc.ATT.COM (david.w.dykstra) (07/28/89)

From article <1260@cbnewsl.ATT.COM>, by raj@cbnewsl.ATT.COM (Richard A. Johnson):
 > In article <1925@cbnewsc.ATT.COM>, levy@cbnewsc.ATT.COM (Daniel R. Levy) writes:
 >> 
 >> I was one of the beta testers for the '88 ksh, and to the best of my memory,
 >> this bug is in the 11/16/88 ksh, but not in the 11/16/88a ksh or earlier '86
 >> ksh.
 >> 
Yes, here's the line from RELEASEa:
	q.  If the name of the directory you are in contained a :,
	    a cd command to a relative pathname did always work correctly.
						   ^
					I assume 'not' goes here.

 > I was also a beta-tester and am now running ksh version 11/16/88a.
 > The bug does appear on my 3B2 running SVR3.1, and can be reproduced
 > as follows (in case there is still a question about what the bug is):
 > 
 > 	$ CDPATH=/usr:/usr/raj
 > 	$ export CDPATH
 > 	$ cd /usr/raj
 > 	$ mkdir c:
 > 	$ cd c:
 > 	$ mkdir xyz
 > 	$ cd xyz
 > 	ksh: xyz:  not found
 > 	$
That's not a bug, that's a feature!  Your CDPATH does not include '.' so
cd will not search your current directory.

- Dave Dykstra
  ttrdf!dwd