Most of these completion scripts in /etc/bash.completion.d are wrong in some way -- filenames and line numbers included: Anyplace it is using [ instead of [[ is probably wrong in a bash-completion script. ant:50: [ ! -f $buildfile ] && return 0 aria2:77: [ ${#COMPREPLY[@]} -eq 0 ] && _filedir aria2c:77: [ ${#COMPREPLY[@]} -eq 0 ] && _filedir bash-builtins:63: elif [ $COMP_CWORD -eq 1 ]; then bluez:58: if [ -z $arg ]; then bluez:70: if [ $args -eq 2 ]; then bluez:79: if [ $args -eq 2 ]; then bluez:86: if [ $args -eq 2 ]; then bluez:94: if [ $args -eq 2 ]; then bluez:102: if [ $args -eq 2 ]; then bluez:132: if [ -z $arg ]; then bluez:217: if [ -z $arg ]; then bluez:227: if [ $args -eq 2 ]; then bluez:232: if [ $args -eq 3 ]; then bluez:258: if [ -z $arg ]; then bluez:269: if [ $args -eq 2 ]; then bluez:317: if [ -z $arg ]; then bluez:333: if [ $args -eq 2 ]; then bluez:339: if [ $args -eq 2 ]; then bluez:346: if [ $args -eq 2 ]; then bluez:418: if [ $args -eq 1 ]; then cardctl:11: if [ $COMP_CWORD -eq 1 ]; then cfengine:68: [ ! -f $hostfile ] && return 0 cksfv:11: if [ $COMP_CWORD -eq 1 ]; then colormgr-completion.bash:57: if [ $# -gt 2 ]; then colormgr-completion.bash:75: while [ $c -lt $COMP_CWORD ]; do cpio:41: if [ $COMP_CWORD -eq 1 ]; then cryptsetup:31: if [ -z $arg ]; then cvs:6: [ -z ${prefix:-} ] || prefix=${cur%/*}/ cvs:7: [ -r ${prefix:-}CVS/Entries ] || prefix="" cvs:13: [ -r ${prefix:-}CVS/Entries ] && \ cvs:50: [ -r ~/.cvspass ] && \ cvs:52: [ -r CVS/Root ] && cvsroots=( "${cvsroots[@]}" $(cat CVS/Root) ) cvs:67: [ $count -eq $COMP_CWORD ] && break cvs:332: if [ -r ${cvsroot}/${prefix} ]; then dict:65: [ -r $dictfile ] && \ e2fsprogs:92: if [ $cword -eq 1 ]; then gdb:11: if [ $COMP_CWORD -eq 1 ]; then gdb:30: elif [ $COMP_CWORD -eq 2 ]; then ---------------------------- This: gdbus-bash-completion.sh:22: while [ $((--i)) -ge 0 ]; do doesn't make sense. Using $((--i)) looks like someone tried to use a posix form, but "--" isn't a supported posix operator. But why mix square brackets with arithmetic expressions? It would be better written as: "while (( --i >= 0 )); do" --------------------------------- More lines below are problematic in some way -- nearly all because they use '[' with an unquoted variable. '[[' quotes variables, '[' does not. (There are also many places where quotes are used with [[]], but those less often harmful). It may be that some BASH vars are almost always likely to be defined, but they still shouldn't be used in '[' Also if doing a numeric comparison, use numeric comparison opts... like instead of: getent:41: if [ $COMP_CWORD -eq 1 ]; then use: if ((COMP_CWORD == 1 )); then If these were NOT bash completion scripts but needed to be portable to other POSIX ' shells, then there would be good reason not to use bashisms, but in bash completion scripts?? Also unquoted vars with '[' are always bad... (sorry in advance if I accidently included some constructs that could be valid, looked for single brackets and a lack of quotes between them as a starting point...) git-prompt.sh:256: if [ $pcmode = yes ]; then git-prompt.sh:346: if [ $pcmode = yes ]; then git-prompt.sh:359: if [ $detached = no ]; then git.sh:45: elif [ -d .git ]; then git.sh:140: [ $i -gt 0 ] && git.sh:147: if [ $j -ge 2 ] && [ -n "$first" ]; then git.sh:152: if [ $i = $COMP_CWORD ]; then git.sh:163: if [ $i = $COMP_CWORD ]; then git.sh:179: while [ $# -gt 0 ]; do git.sh:452: while [ $c -lt $cword ]; do git.sh:475: if [ $no_complete_refspec = 1 ]; then git.sh:496: if [ $lhs = 1 ]; then git.sh:503: if [ $lhs = 1 ]; then git.sh:510: if [ $lhs = 1 ]; then git.sh:712: while [ $c -lt $cword ]; do git.sh:727: while [ $c -lt $cword ]; do git.sh:848: while [ $c -lt $cword ]; do git.sh:1571: while [ $c -gt 1 ]; do git.sh:2313: while [ $c -lt $cword ]; do git.sh:2332: if [ $f = 1 ]; then git.sh:2353: while [ $c -lt $cword ]; do ifupdown:11: if [ $COMP_CWORD -eq 1 ]; then info:23: elif [ ${INFOPATH:+set} ]; then ipmitool:80: [ ${COMP_WORDS[i]} = $c ] && cmd=$c && break ipsec:12: if [ $COMP_CWORD -eq 1 ]; then jar:11: if [ $COMP_CWORD = 1 ]; then java:74: elif [ -d $i ]; then java:105: if [ -d $i ]; then kldload:11: [ -d $moddir ] || moddir=/boot/kernel/ links:24: if [ -r ~/.links/links.his ]; then lvm:365: if [ $args -eq 0 ]; then lvm:434: if [ $args -eq 0 ]; then lvm:466: if [ $args -eq 0 ]; then lvm:802: if [ $args -eq 0 ]; then lvm:910: if [ $args -eq 0 ]; then lvm:944: if [ $args -eq 0 ]; then lvm:960: if [ $COMP_CWORD -eq 1 ]; then mercurial.sh:27:# if [ -r ~/.patchbomb-$1 ]; then mercurial.sh:186: if [ -z "$cmd" ] || [ $COMP_CWORD -eq $i ]; then mercurial.sh:199: if [ $? -ne 0 ]; then mercurial.sh:217: if [ $canonical = 1 ]; then mercurial.sh:271: if [ $count = 1 ]; then mercurial.sh:317: if [ $? -eq 0 ] && [ "$patches" ]; then mercurial.sh:427: if [ $count = 1 ]; then mercurial.sh:508: if [ -z "$subcmd" ] || [ $COMP_CWORD -eq $i ] || [ "$subcmd" = help ]; then mtx:23: if [ $COMP_CWORD -gt 1 ]; then mutt:26: while [ $# -gt 0 ]; do mutt:28: if [ ${#1} -gt 2 ]; then mutt:40: if [ -f ~/.${muttcmd}rc ]; then mutt:42: elif [ -f ~/.${muttcmd}/${muttcmd}rc ]; then openssl:20: [ -f $f ] && config=$f && break openssl:52: if [ $COMP_CWORD -eq 1 ]; then p4:17: if [ $cword -eq 1 ]; then p4:19: elif [ $cword -eq 2 ]; then p4:32: elif [ $cword -gt 2 ]; then perf:38: if [ $COMP_CWORD -eq 1 ]; then pk-completion.sh:74: while [ $c -lt $COMP_CWORD ]; do pk-completion.sh:95: while [ $c -lt $COMP_CWORD ]; do postgresql:17: [ ${#COMPREPLY[@]} -eq 0 ] && COMPREPLY=( $( compgen -u -- "$cur" ) ) quilt.sh:110: if [ ${COMP_WORDS[1]} == -h ] ; then quilt.sh:117: if [ ${#command_matches[@]} -ne 1 ] ; then rpm:61: if [ $COMP_CWORD -eq 1 ]; then service:7:{ have service || [ -d /etc/init.d/ ]; } && service:20: [ $COMP_CWORD -gt 2 ] && return 0 service:25: [ -d /etc/rc.d/init.d ] && \ sitecopy:23: if [ -r ~/.sitecopyrc ]; then ssh:173: while [ $# -gt 0 ]; do ssh:175: if [ ${#1} -gt 2 ]; then ssh:186: if [ $COMP_CWORD -ne 1 ]; then ssh:230: while [ $# -gt 0 ]; do ssh:232: if [ ${#1} -gt 2 ]; then ssh:360: while [ $# -gt 0 ]; do ssh:362: if [ ${#1} -gt 2 ]; then strace:24: if [ $offset -gt 0 ]; then subversion:41: [ $tag = 'END' ] && break subversion:42: [ $tag != 'K' ] && { subversion:48: [ $tag != 'V' ] && { subversion:248: [ $last = 'none' ] && { last='first'; continue ; } subversion:407: if [ -r $file ] ; then subversion:510: if [ -r $file ] ; then subversion:575: [ ${#COMPREPLY[@]} -eq 1 ] && return 0 subversion:1017: if [ $isHelpCmd ] ; then subversion:1441: if [ $last = 'none' ] ; then sysv-rc:92: elif [ -x $sysvdir/$prev ]; then tar:11: if [ $COMP_CWORD -eq 1 ]; then udisksctl-bash-completion.sh:26: while [ $((--i)) -ge 0 ]; do unace:14: if [ $COMP_CWORD -eq 1 ]; then unrar:16: if [ $COMP_CWORD -eq 1 ]; then update-alternatives:9: [ -d /var/lib/$i ] && admindir=/var/lib/$i && break util-linux:64: if [ $COMP_CWORD = 1 ]; then wodim:84: if [ $COMP_CWORD -gt 1 ]; then wodim:103: if [ $track_mode -eq 0 ]; then wtf:16: while [ $# -gt 0 ]; do wtf:22: [ -z $db ] && db=${ACRONYMDB:-/usr/share/misc/acronyms*} wtf:24: [ ${BASH_VERSINFO[0]} -ge 4 ] && cur="${cur^^}" yum.bash:59: [ $1 = 1 ] && val='\(1\|yes\|true\|on\)' || val='\(0\|no\|false\|off\)' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org