zsh-users
 help / color / mirror / code / Atom feed
* is this normal?
@ 1999-02-28 19:11 Mircea Damian
  1999-03-01 16:08 ` Larry P . Schrof
  0 siblings, 1 reply; 4+ messages in thread
From: Mircea Damian @ 1999-02-28 19:11 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]


Hello,

I'm using zsh-3.1.5 on many x86 machines. All have the same behavior:

dmircea@secu:~% cd /
dmircea@secu:/% cd ../bin 
dmircea@secu:/../bin% echo $ZSH_VERSION 
3.1.5
dmircea@secu:/../bin% pwd
/../bin
dmircea@secu:/../bin% 


Is that '/../bin' canonical? Do I miss something here?

-- 
Mircea Damian
Network Manager
dmircea@roedu.net, dmircea@lbi.ro, dmircea@kappa.ro
MD65-RIPE, MD2225, MD1-6BONE
Phone: +40-1-4115246

[-- Attachment #2: Type: application/pgp-signature, Size: 248 bytes --]

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

* Re: is this normal?
  1999-02-28 19:11 is this normal? Mircea Damian
@ 1999-03-01 16:08 ` Larry P . Schrof
  1999-03-01 17:44   ` Mircea Damian
  0 siblings, 1 reply; 4+ messages in thread
From: Larry P . Schrof @ 1999-03-01 16:08 UTC (permalink / raw)
  To: zsh-users

This brings up an interesting point.

First, remember that in the / directory, the file .. just points back
to / itself.

Now, I tried the following quick experiment.

Things to note:

- I use %~ in my RPROMPT string.

- $PWD seems to contain the 'pure' value of the current directory,
  pwd seems to heed any directory-processing options you have set
  (IE. chase_links)

- Like the man page says, indeed, the various escape sequences expand
  to the 'pure' value of $PWD.

lyric[79] cd /                                                                ~
lyric[80] cd ../etc                                                           /
lyric[81] pwd                                                           /../etc
/../etc
lyric[82] echo $PWD                                                     /../etc
/../etc
lyric[83] cd /                                                          /../etc


lyric[84] setopt chaselinks                                                   /
lyric[85] cd ../etc                                                           /
lyric[86] pwd                                                           /../etc
/etc
lyric[87] echo $PWD                                                     /../etc
/../etc
lyric[88] echo $ZSH_VERSION                                             /../etc
3.1.5

One way to resolve the quirkiness (but not necessarily the only) is to
do command substitution in the PROMPT string by running pwd. (Don't forget
to set the PROMPT_SUBST option) Note that for me, RPROMPT is the variable
to change, since that's where I display the current directory.

lyric[93] RPROMPT='$(pwd)'                                              /../etc
lyric[94]                                                                  /etc

This is only a quick fix for PROMPT-related issues. Other things such
as the directory stack still receive 'pure' values of $PWD.

Anyone else's thoughts?

On Sun, Feb 28, 1999 at 09:11:59PM +0200, Mircea Damian wrote:
> 
> Hello,
> 
> I'm using zsh-3.1.5 on many x86 machines. All have the same behavior:
> 
> dmircea@secu:~% cd /
> dmircea@secu:/% cd ../bin 
> dmircea@secu:/../bin% echo $ZSH_VERSION 
> 3.1.5
> dmircea@secu:/../bin% pwd
> /../bin
> dmircea@secu:/../bin% 
> 
> 
> Is that '/../bin' canonical? Do I miss something here?
> 
> -- 
> Mircea Damian
> Network Manager
> dmircea@roedu.net, dmircea@lbi.ro, dmircea@kappa.ro
> MD65-RIPE, MD2225, MD1-6BONE
> Phone: +40-1-4115246



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

* Re: is this normal?
  1999-03-01 16:08 ` Larry P . Schrof
@ 1999-03-01 17:44   ` Mircea Damian
  1999-03-01 18:51     ` Sweth Chandramouli
  0 siblings, 1 reply; 4+ messages in thread
From: Mircea Damian @ 1999-03-01 17:44 UTC (permalink / raw)
  To: Larry P . Schrof; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

On Mon, Mar 01, 1999 at 10:08:24AM -0600, Larry P . Schrof wrote:
> First, remember that in the / directory, the file .. just points back
> to / itself.
This is normal. That is why this happens:

root@taz:~# cd /
root@taz:/# cd ../bin/..
root@taz:/..#                      <-- here /.. == /

But then it looks very odd to me  when I try multiple "../" constructions
like:


root@taz:~# cd /
root@taz:/# cd ../../bin
root@taz:/bin#                                  <-- why not /../../bin
root@taz:/bin# cd /
root@taz:/# cd ../../../bin
root@taz:/../bin# cd /
root@taz:/# cd ../../../../bin
root@taz:/bin#

As far as I see this happens only when the number of "../" is odd so I
think that this is a bug!



> lyric[93] RPROMPT='$(pwd)'                                              /../etc
> lyric[94]                                                                  /etc
As you said, this is only a quick but dirty fix. :-(


-- 
Mircea Damian
Network Manager
dmircea@roedu.net, dmircea@lbi.ro, dmircea@kappa.ro
MD65-RIPE, MD2225, MD1-6BONE

[-- Attachment #2: Type: application/pgp-signature, Size: 248 bytes --]

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

* Re: is this normal?
  1999-03-01 17:44   ` Mircea Damian
@ 1999-03-01 18:51     ` Sweth Chandramouli
  0 siblings, 0 replies; 4+ messages in thread
From: Sweth Chandramouli @ 1999-03-01 18:51 UTC (permalink / raw)
  To: zsh-users

On Mon, Mar 01, 1999 at 07:44:55PM +0200, Mircea Damian wrote:
> root@taz:/# cd ../../../../bin
> root@taz:/bin#
> 
> As far as I see this happens only when the number of "../" is odd so I
> think that this is a bug!

	especially since it also does not happen at all for "./".

	-- sweth.

-- 
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@gwu.edu> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>


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

end of thread, other threads:[~1999-03-01 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-28 19:11 is this normal? Mircea Damian
1999-03-01 16:08 ` Larry P . Schrof
1999-03-01 17:44   ` Mircea Damian
1999-03-01 18:51     ` Sweth Chandramouli

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).