On 1/14/15 9:09 AM, Ondrej Oprala wrote: > reproducer: > cd ~ > mkdir MYDIR > cd MYDIR > echo "${PWD/#$HOME/~}" > > Result of echo in 4.3: > /home/<user>/MYDIR > > Result of echo in 4.2: > ~/MYDIR > > Is tilde expansion in 4.3 supposed to happen?
Yes. It's a Posix change. Look at http://austingroupbugs.net/view.php?id=221, which reads, in part: "For the four varieties of parameter expansion that provide for substring processing (see [xref to 2.6.2 Parameter Expansion]), within the string of characters from an enclosed "${" to the matching '}', the double-quotes within which the expansion occurs shall have no effect on the handling of any special characters." which basically means that the outer quotes don't mean the stuff inside the braces is quoted. This was part of a cleanup of the semantics of quotes surrounding a parameter expansion and how those quotes affect character handling inside the expansion. Look at threads including http://lists.gnu.org/archive/html/bug-bash/2014-10/msg00197.html http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00038.html http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00077.html and go back from there. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/