bash autocompletion for umount messed up

Bug #346520 reported by Nonconventionally Creative
This bug report is a duplicate of:  Bug #249337: bash get_cword: command not found. Edit Remove
2
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

Ubuntu 8.10
bash-completion 20060301-4ubuntu1
Scenario: in bash, type <optional: sudo > umount <space> <tab>
Expected: display list of mount points
Actual: mount points are pasted into the command line, with n corrupted to newline.
/lib/i
it/rw
/proc
/sys
/var/ru

/var/lock
/dev
/dev/shm
/dev/pts
/sys/fs/fuse/co

ectio
s
/lib/modules/2.6.27-11-ge
eric/volatile
/proc/bus/usb
/sys/ker
el/security
/proc/sys/fs/bi
fmt_misc
<press enter>
umount: only root can unmount UUID=********-****-****-****-************ from /
bash: /lib/i: No such file or directory
bash: it/rw: No such file or directory
bash: /proc: is a directory
bash: /sys: is a directory
bash: /var/ru: No such file or directory
bash: /var/lock: is a directory
bash: /dev: is a directory
bash: /dev/shm: is a directory
bash: /dev/pts: is a directory
bash: /sys/fs/fuse/co: No such file or directory
<pause for several seconds>
bash: ectio: command not found
bash: s: command not found
bash: /lib/modules/2.6.27-11-ge: No such file or directory
bash: eric/volatile: No such file or directory
bash: /proc/bus/usb: is a directory
bash: /sys/ker: No such file or directory
bash: el/security: No such file or directory
bash: /proc/sys/fs/bi: No such file or directory
bash: fmt_misc: command not found

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 249337, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

This is also resolved on the last package on Jaunty, no backport in prevision for this package.

Revision history for this message
Anishsane (anish-sane) wrote :

in ur bashrc, after lines:
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

add following contents:

_umount()
{
 local cur

 COMPREPLY=()
 cur=`_get_cword`

 OLDIFS="$IFS"
 unset IFS
 COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- $cur ) )
 IFS="$OLDIFS"

 return 0
}
complete -F _umount $dirnames umount

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.