zsh-workers
 help / color / mirror / code / Atom feed
* cd $DIR_NAME problem
@ 1995-05-19 10:57 Joe Walker
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Walker @ 1995-05-19 10:57 UTC (permalink / raw)
  To: zsh-workers


I found a very wierd problem by trying to run a GNU configure script.
A boiled down version is below:

% pwd
	/home/jurua/walkerjj/l

% ls -l

	total 2
	drwxr-xr-x  2 walkerjj      512 May 11 15:43 test_dir
	-rwxr-xr-x  1 walkerjj       84 May 11 15:43 test_script

% cat test_script

	#!/bin/sh -x

	DIR="test_dir"
 	echo "DIR is ($DIR)"
	cd $DIR
	echo "Test passed"

% test_script

	DIR=test_dir
	+ echo DIR is (test_dir)
	DIR is (test_dir)
	+ cd test_dir
	test_script: test_dir: bad directory


So that is the problem: any shell script that changes to a directory using a
variable, fails.

However it get stranger:

% mv test_* ..
% cd ..
% pwd
	/home/jurua/walkerjj

% test_script

	DIR=test_dir
	+ echo DIR is (test_dir)
	DIR is (test_dir)
	+ cd test_dir
	+ echo Test passed
	Test passed


For all of the above:

% echo $ZSH_VERSION

	2.6-beta8

% uname -a

	SunOS jurua 4.1.3_U1 8 sun4m


I've only edited the output to make it easier to read.
Sorry but I don't know enough about Z-shell internals yet to be able to suggest
a fix.

Thanks,

Joe.

--

  ____
 |___ | ___  ___   EMail: walkerjj@sweng.ecid.cig.mot.com
 _  | |/ _ \| __|  SMail: Motorola, 16 Euroway, Blagrove, SWINDON SN58YQ
| |_| | (_) | _|   Tel:   [+44/0] 793 54 5346
 \___/ \___/|___|  Fax:   [+44/0] 793 54 1228


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cd $DIR_NAME problem
       [not found] <13662.9505191455@pyro.swan.ac.uk>
@ 1995-05-31 10:19 ` Joe Walker
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Walker @ 1995-05-31 10:19 UTC (permalink / raw)
  To: P.Stephenson, zsh-workers

,- About Re: cd $DIR_NAME problem, P.Stephenson@swansea.ac.uk wrote:
|
| walkerjj@jurua.sweng.ecid.cig.mot.com wrote:
| >
| > I found a very wierd problem by trying to run a GNU configure script.
| > A boiled down version is below:
| > % test_script
| >
| > 	DIR=test_dir
| > 	+ echo DIR is (test_dir)
| > 	DIR is (test_dir)
| > 	+ cd test_dir
| > 	test_script: test_dir: bad directory
|
| My guess is that CDPATH doesn't contain `.'.  Shells differ over
| whether they implicitly look in . anyway or don't in this case.  This
| hit me some time ago.

Thanks. the explanation is correct.
I'm not sure that this isn't a bug though- the situation seams to be:

If the 'cd' command uses a variable then require . to be in CDPATH
otherwise don't.

So Zsh seams to be in disagreement with itself.
Is this correct?

Joe.

--
  ____
 |___ | ___  ___   EMail: walkerjj@sweng.ecid.cig.mot.com
 _  | |/ _ \| __|  SMail: Motorola, 16 Euroway, Blagrove, SWINDON SN58YQ
| |_| | (_) | _|   Tel:   [+44/0] 793 54 5346
 \___/ \___/|___|  Fax:   [+44/0] 793 54 1228


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-05-31 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-05-19 10:57 cd $DIR_NAME problem Joe Walker
     [not found] <13662.9505191455@pyro.swan.ac.uk>
1995-05-31 10:19 ` Joe Walker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).