[prev in list] [next in list] [prev in thread] [next in thread]
List: bash-bug
Subject: Re: pwd or shell prompt doesn't update after renaming a parent dir
From: Chet Ramey <chet.ramey () case ! edu>
Date: 2010-03-25 12:59:49
Message-ID: 100325125949.AA62816.SM () caleb ! INS ! CWRU ! Edu
[Download RAW message or body]
> Bash Version: 4.0
> Patch Level: 33
> Release Status: release
>
> Description:
> suppose there is a dir called "1" when i'm in it and i use "mv ../1
> ../44" command for example, mv does the job. but nor pwd or shell prompt
> does not show the change until i go back to the parent of "1" directory.
By default, bash uses a logical view of the file system, in which $PWD
and pwd report the current directory using the path used to get there.
If you don't want bash to do that by default, use `set -o physical' or
`pwd -P'. `pwd -P' will show the true physical path, but not modify
$PWD.
If you want bash to re-evaluate its idea of the current working
directory, which is reflected in $PWD, you have to force that
reevaluation. Bash doesn't and can't know that the directory path has
changed underneath it. You can use `cd .' to force bash to recompute
the current directory path if you change parent directories.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic