bash-completion-Bugs item #314708 was changed at 03/06/2014 22:00 by Dams Nadé You can respond by visiting: https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314708&group_id=100114
Status: Open Priority: 3 Submitted By: Dams Nadé (anvil-guest) Assigned to: Nobody (None) Summary: Array element unset needs to be quoted Distribution: None Originally reported in: None Milestone: 2.0 Status: None Original bug number: Initial Comment: unsetting an array element needs to be quoted to prevent globbing to interfer. See this example : [anvil@tartine ~/git/bash-completion]# LC_ALL=en_US bash [anvil@tartine bash-completion]$ shopt -s failglob [anvil@tartine bash-completion]$ foo=(1 2 3) [anvil@tartine bash-completion]$ unset foo[1] bash: no match: foo[1] [anvil@tartine bash-completion]$ unset 'foo[1]' ; echo $? 0 Please consider applying attached patch, which fixes a bunch of issues when using failglob. Without attached patch : -# of expected passes 648 -# of unexpected failures 45 -# of unresolved testcases 33 With : +# of expected passes 673 +# of unexpected failures 23 +# of unresolved testcases 29 ---------------------------------------------------------------------- Comment By: Dams Nadé (anvil-guest) Date: 03/06/2014 22:00 Message: Here is a second patch, with the same problem, this time in completion files. It fixes crontab, cvs, badblocks, find, info, lvm, modprobe, protoc and qdbus when used with failglob. ---------------------------------------------------------------------- Comment By: Ville Skyttä (scop-guest) Date: 03/06/2014 12:55 Message: When I tested this yesterday, I found that quoting it also failed to actually unset anything. Now I can't reproduce that finding, I suppose I did something silly/faulty. Looks like the bash man page contains a subtle hint about the necessity of quoting: "unset name[subscript] destroys the array element at index subscript. Care must be taken to avoid unwanted side effects caused by pathname expansion." ---------------------------------------------------------------------- You can respond by visiting: https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314708&group_id=100114 _______________________________________________ Bash-completion-devel mailing list Bash-completion-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-devel