Bug 61129 - incorrect ~ substitution in some cases
incorrect ~ substitution in some cases
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
i386 Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
Depends On:
  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:
Last Closed: 2002-08-28 13:54:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 ~:
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/~}

If you change the expression to:
Then the substitution will only be performed at the beginning of the string.

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

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

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