Package: bash
Version: 4.2-1
Severity: normal
Tags: patch

My "$HOME"/.bashrc does set -u, which causes it to warn about dereferencing undefined variables. Whenever I start a shell, I get a warning (in LANG=fi_FI.utf8) like this:

bash: debian_chroot: sitomaton muuttuja

The fix is simple. In /etc/bash.bashrc, replace $debian_chroot with ${debian_chroot:-}. This should work even in dash:

- if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+ if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then

There are similar problems in the bash-completion package, which prompted me to uninstall it. (It spit out similar messages, and completion did not work at all when the package was installed.)


-- System Information:
Debian Release: wheezy/sid
 APT prefers testing
 APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fi_FI.utf8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash depends on:
ii  base-files   6.5
ii  dash         0.5.7-2
ii  debianutils  4.2.1
ii  libc6        2.13-26
ii  libtinfo5    5.9-4

Versions of packages bash recommends:
pn  bash-completion  <none>

Versions of packages bash suggests:
pn  bash-doc  <none>

-- Configuration Files:
/etc/bash.bashrc changed:
[ -z "$PS1" ] && return
shopt -s checkwinsize
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
   debian_chroot=$(cat /etc/debian_chroot)
fi
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then
        function command_not_found_handle {
                # check because c-n-f could've been removed in the meantime
               if [ -x /usr/lib/command-not-found ]; then
                   /usr/bin/python /usr/lib/command-not-found -- "$1"
                  return $?
               elif [ -x /usr/share/command-not-found ]; then
                   /usr/bin/python /usr/share/command-not-found -- "$1"
                  return $?
                else
                   return 127
                fi
        }
fi


-- no debconf information



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to