zsh-users
 help / color / mirror / code / Atom feed
* Some strange behavior of %~
@ 2005-08-11  7:21 Artur Penttinen
  2005-08-11  9:53 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Artur Penttinen @ 2005-08-11  7:21 UTC (permalink / raw)
  To: zsh-users


                   Hello!


  # uname -osr
  Linux 2.4.21-27.0.4.NOEL GNU/Linux
  # cd work
  # print -P "%~"
  ~/work
  # cd ../work
  print -P "%~"
  ~/work
  # print $ZSH_VERSION
  4.2.5
  #

  # uname -sr
  FreeBSD 4.7-RELEASE
  # cd work
  # print -P "%~"
  ~/work
  # cd ../work
  # print -P "%~"
  /hipsohome/home/arpentti/work
  # print $ZSH_VERSION
  4.2.5
  #

  Both installation has same config files.

-- 
wbw, artur penttinen


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

* Re: Some strange behavior of %~
  2005-08-11  7:21 Some strange behavior of %~ Artur Penttinen
@ 2005-08-11  9:53 ` Peter Stephenson
  2005-08-11 11:37   ` Artur Penttinen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2005-08-11  9:53 UTC (permalink / raw)
  To: zsh-users

"Artur Penttinen" wrote:
>   # cd work
>   # print -P "%~"
>   ~/work
>   # cd ../work
>   # print -P "%~"
>   /hipsohome/home/arpentti/work
>   # print $ZSH_VERSION
>   4.2.5
>   #

This is probably something to do with using an automounter.  I would
guess that $HOME is /home/arpentti, right?  On the second system, 
this probably gets created as a link to /hipsohome/home/arpentti which
will be where the automounter mounts the directory.  (Or the person
responsible just likes symbolic links.)

Quite why the cd works that way I'm not sure, but it's possibly you
have the CHASE_LINKS option set, in which case the symbolic links are
resolved.  But that obviously didn't happen with the first cd.

Using both "pwd -L" and "pwd -P" (print logical and physical directory)
after each step might make it clearer.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: Some strange behavior of %~
  2005-08-11  9:53 ` Peter Stephenson
@ 2005-08-11 11:37   ` Artur Penttinen
  0 siblings, 0 replies; 3+ messages in thread
From: Artur Penttinen @ 2005-08-11 11:37 UTC (permalink / raw)
  To: zsh-users

>"Artur Penttinen" wrote:
>>   # cd work
>>   # print -P "%~"
>>   ~/work
>>   # cd ../work
>>   # print -P "%~"
>>   /hipsohome/home/arpentti/work
>>   # print $ZSH_VERSION
>>   4.2.5
>>   #
>
>This is probably something to do with using an automounter.  I would
>guess that $HOME is /home/arpentti, right?  On the second system, 
>this probably gets created as a link to /hipsohome/home/arpentti which
>will be where the automounter mounts the directory.  (Or the person
>responsible just likes symbolic links.)

  Yes, You're right.
  # ls -l /home
  lrwxr-xr-x  1 root  wheel  15 Aug 23  2004 /home@ -> /hipsohome/home
  #

>Quite why the cd works that way I'm not sure, but it's possibly you
>have the CHASE_LINKS option set, in which case the symbolic links are
>resolved.  But that obviously didn't happen with the first cd.
>
>Using both "pwd -L" and "pwd -P" (print logical and physical directory)
>after each step might make it clearer.

  # [[ -o chaselinks ]] || print no
  no
  # 

  Question: what i will set for proper behavior of `%~' ?
  Yes, I can set HOME=/hipsohome/home/arpentti, but imho,
  this is politically incorrect...


-- 
wbw, artur penttinen


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

end of thread, other threads:[~2005-08-11 11:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11  7:21 Some strange behavior of %~ Artur Penttinen
2005-08-11  9:53 ` Peter Stephenson
2005-08-11 11:37   ` Artur Penttinen

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