Bug 1309920

Summary: bash completion unbound variables errors after "unset LS_COLORS" command
Product: [Fedora] Fedora Reporter: Noel McLoughlin <noel.mcloughlin>
Component: bash-completionAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: high    
Version: rawhideCC: mtessun, noel.mcloughlin, ooprala, orhan.biyiklioglu, ovasik, pstodulk, saravana0209, sheltren, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1055784 Environment:
Last Closed: 2016-02-19 17:40:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Noel McLoughlin 2016-02-19 00:18:05 UTC
+++ This bug was initially created as a clone of Bug #1055784 +++

Description of problem:

Executing 'unset LS_COLORS' results in 'unbound variable errors' from bash completion.

Version-Release number of selected component (if applicable):

bash-completion-2.1-9.20150513git1950590.fc24.noarch

How reproducible:

Always

Steps to Reproduce:
1. $ /bin/bash
2. $ unset LS_COLORS
3. Use bash completion
   (a) Type any command AND hit the tab key
   (b) Hit the tab key

Actual results:

(a) Type any command AND hit the tab key

$ cd <TAB KEY HERE>-bash: !ref: unbound variable
cd ER-bash: !ref: unbound variable

$ systemct -bash: !ref: unbound variable

(b) Hit the tab key

$ -bash: words[@]: unbound variable


Expected results:

TBD via consensus


Additional info:

$ env | grep LS_COLORS
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=3
0;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01
;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31
:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:
*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31
:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01
;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m
2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:
*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:
*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.m4a=01;36:*.mid=01;36:*.midi=01;

$ unset LS_COLORS

Comment 1 Ville Skyttä 2016-02-19 15:22:04 UTC
I cannot reproduce, neither in F-23 with upstream bash-completion development head, nor with a clean mock F-24 chroot. And quite frankly, I don't see how unsetting LS_COLORS could actually result in the described problems. Going to need more information in order to be say much more.

On the other hand, these errors after "set -u" or "set -o nounset" and as described in bug #1055784 is a known limitation in bash-completion, documented in its README's troubleshooting section. Have you made sure that this is not the actual source of the issue you see?

Comment 2 Noel McLoughlin 2016-02-19 17:39:56 UTC
My bad. I've been troubleshooting #1306804 and did indeed run "set -u" before running "unset" command. Sorry you spent time on this.

[bob@rawhide ws]$ history | grep LS_COLORS
  132  set -u LS_COLORS
  135  unset LS_COLORS
  152  unset LS_COLORS
  158  unset LS_COLORS
  189  env | grep LS_COLORS
  190  unset LS_COLORS
  198  history | grep LS_COLORS
[bob@rawhide litp]$ 
[bob@rawhide litp]$ set -u LS_COLORS
[bob@rawhide litp]$ -bash: words[@]: unbound variable

Closing this as duplicate.

Comment 3 Noel McLoughlin 2016-02-19 17:40:24 UTC

*** This bug has been marked as a duplicate of bug 1055784 ***