Description of problem: The latest bash-completion breaks when using rsync, scp and trying to complete path names. For example, with rsync bash pops up an error that the pidof command is not found. Adding /sbin to the path (to find pidof) causes the following error (but the completion still seems to work): Invalid command line argument: ? Version-Release number of selected component (if applicable): 1.1-6.el5 How reproducible: Every time Steps to Reproduce: 1. install bash-completion 2. try to use commandline completion with rsync or scp rsync -avux --delete ~/ [tab] Actual results: Without /sbin in path, bash complains that pidof is not found. With /sbin in path, bash complains about an invalid command line error Expected results: No error is emitted when using tab to complete the pathname
Reproduced, except I cannot get the "Invalid command line argument: ?" error to occur when /sbin is in $PATH. Could you do a "set -x" in a shell while /sbin is in $PATH and attach the output here (be sure to review and possibly edit it before posting in case it has something you'd rather not post in public)? A workaround for now is to apply the latter hunk of this patch to /etc/bash_completion: http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=bb8912b Another workaround is to remove the avahi-tools package in case you don't need it.
How about I post just the part that looks useful? I can post the rest if you need... Here's the command line -- notice that I hit [tab] after "rsync -avux --delete ~/": $ rsync -avux --delete ~/+ local cur prev shell i userhost path Here's what looks to be the relevant output: + type avahi-browse ++ pidof avahi-daemon + '[' -n '4466 4465' ']' + COMPREPLY=("${COMPREPLY[@]}" $( compgen -W "$( avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u )" -- "$cur" )) +++ grep '^=' +++ cut '-d;' -f7 +++ sort -u +++ avahi-browse -cpr _workstation._tcp Invalid command line argument: ?
That may be enough, thanks. Do you get the same error message if you run these commands directly? avahi-browse -cpr _workstation._tcp avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u
Yes in both cases.
Ouch, EL5's avahi-browse doesn't support the -p option; I don't know how I missed that earlier. While waiting for a fixed package, the workarounds in comment 1 should work, and additionally the whole "if" block that deals with avahi-daemon and avahi-browse in /etc/bash_completion can be removed or commented out.
bash-completion-1.2-3.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/bash-completion-1.2-3.el5
bash-completion-1.2-4.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.