Bug 61129 - incorrect ~ substitution in some cases
incorrect ~ substitution in some cases
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
7.2
i386 Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-13 18:05 EST by Mike McLean
Modified: 2014-03-16 22:26 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-28 13:54:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike McLean 2002-03-13 18:05:11 EST
* setup-2.5.7-1

/etc/bashrc uses the following expression to obtain a working directory string
relative to ~:
         ${PWD/$HOME/~}
This replaces all occurences of $HOME with "~", even in the middle of the path,
which can lead to odd looking paths.

$ cd /tmp/home/mike/foo
$ echo ${PWD/$HOME/~}
/tmp~/foo

If you change the expression to:
        ${PWD/#$HOME/~}
Then the substitution will only be performed at the beginning of the string.

$ cd /tmp/home/mike/foo
$  echo ${PWD/#$HOME/~}
/tmp/home/mike/foo
$ cd /home/mike/Mail
$  echo ${PWD/#$HOME/~}
~/Mail


if you have applied the patch from bug#60596, then this expression will occur
twice in /etc/bashrc
Comment 1 Preston Brown 2002-08-28 13:54:29 EDT
fixed in 2.5.19 and later Mike.
Comment 2 Mike McLean 2002-09-26 14:59:52 EDT
confirmed
CLOSING->RAWHIDE

Note You need to log in before you can comment on or make changes to this bug.