Bug 61129 - incorrect ~ substitution in some cases
Summary: incorrect ~ substitution in some cases
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: setup   
(Show other bugs)
Version: 7.2
Hardware: i386 Linux
low
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-13 23:05 UTC by Mike McLean
Modified: 2014-03-17 02:26 UTC (History)
1 user (show)

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


Attachments (Terms of Use)

Description Mike McLean 2002-03-13 23:05:11 UTC
* 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 17:54:29 UTC
fixed in 2.5.19 and later Mike.

Comment 2 Mike McLean 2002-09-26 18:59:52 UTC
confirmed
CLOSING->RAWHIDE


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