[Bug 1398799] [NEW] /etc/profile.d/vte.sh: need to quote ~

Peter Cordes peter at cordes.ca
Wed Dec 3 12:10:55 UTC 2014


Public bug reported:

Noticed the bug on trusty, still present in 
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/vte3/vivid/view/head:/src/vte.sh

__vte_prompt_command():
"${PWD/#$HOME/~}"  needs to be
"${PWD/#$HOME/\~}"

because ${parameter/pattern/string} does tilde expansion on string.

  The bash man page looks like its trying to say that it doesn't happen, but it does.
      In  each  of  the  cases below, word is subject to tilde expansion, parameter expansion, command substitution, and arithmetic
       expansion.
Unlike the other things, e.g. ${parameter##word},  ${parameter/pattern/string} uses "string" instead of "word".

 Quoting with a \ should be fine, since quote-removal will get rid of it
even if they change the code to match the docs, and stop doing tilde
expansion on the replacement string.


 Also, this is really a separate bug, but /etc/profile.d/* doesn't get sourced by non-login shells.  This makes /etc/profile.d/vte.sh not very useful.  There really ought to be a similar directory for non-login shells.  bash-completion falls victim to this as well.

** Affects: vte3 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to vte3 in Ubuntu.
https://bugs.launchpad.net/bugs/1398799

Title:
  /etc/profile.d/vte.sh: need to quote ~

Status in vte3 package in Ubuntu:
  New

Bug description:
  Noticed the bug on trusty, still present in 
  http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/vte3/vivid/view/head:/src/vte.sh

  __vte_prompt_command():
  "${PWD/#$HOME/~}"  needs to be
  "${PWD/#$HOME/\~}"

  because ${parameter/pattern/string} does tilde expansion on string.

    The bash man page looks like its trying to say that it doesn't happen, but it does.
        In  each  of  the  cases below, word is subject to tilde expansion, parameter expansion, command substitution, and arithmetic
         expansion.
  Unlike the other things, e.g. ${parameter##word},  ${parameter/pattern/string} uses "string" instead of "word".

   Quoting with a \ should be fine, since quote-removal will get rid of
  it even if they change the code to match the docs, and stop doing
  tilde expansion on the replacement string.

  
   Also, this is really a separate bug, but /etc/profile.d/* doesn't get sourced by non-login shells.  This makes /etc/profile.d/vte.sh not very useful.  There really ought to be a similar directory for non-login shells.  bash-completion falls victim to this as well.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/vte3/+bug/1398799/+subscriptions



More information about the foundations-bugs mailing list