autocompletion: `grep: Trailing backslash` in `sudo mount`

Bug #159874 reported by yurimxpxman
This bug report is a duplicate of:  Bug #194860: Hardy regressions [bash-completion]. Edit Remove
6
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

I have two files in the same directory:

Ramones - End of the Century.mdf
Ramones - End of the Century.mds

The .mdf file is a disk image of the film, so I wished to mount. I did so with:

sudo mount Ram<tab><tab>

where <tab> is my pressing the tab key, of course. Observe the following screenshot:

yurimxpxman@yurimxpxman-desktop:~/Music/The Ramones/Ramones - End of the Century$ sudo mount Ramones\ -\ End\ of\ the\ Century.mdgrep: Trailing backslash
grep: Trailing backslash

I have repeated this on several machines and always had the same problem. It does the same on the x86_64 bit version, as well as the i686. My friend tried to repeat the problem in the same version of bash on arch GNU/Linux, and he was not able to repeat the problem on it, so it is definitely a problem with Ubuntu code.

Thanks

Revision history for this message
yurimxpxman (yurimxpxman) wrote :

BTW, it just occurred to me that I forgot to say which version of Ubuntu this is. It is the latest version, 7.10. I have not tried it on any other versions.

Revision history for this message
Brandon Kruger (bmk789) wrote :

I can confirm this bug on AMD64 as well in verision 3.2.25 of bash.

Revision history for this message
neurophyre (o8ihf4ohkg) wrote :

I can confirm this bug on 7.10, 32-bit x86, bash 3.2.25(1)-release.

Revision history for this message
Mular (kramer-k) wrote :

I too been suffering with this as well.. Bash Version 3.2.25(1)-release as well

Happens a lot when I try to use auto complete on my external drive.
mular@AlphaLinux:~$ ls /media/Local\ Disk/Games/Warcraft\ III/Warcraft\ III\ and\ The\ Frozen\ Throne/
Warcraft III - The Frozen Throne [Disk 1].iso.iso
Warcraft III - The Frozen Throne [Disk2].iso
Warcraft III - The Frozen Throne [Disk3].iso
mular@AlphaLinux:~$ sudo mount -o loop /media/Local\ Disk/Gamgrep: Trailing backslash
grep: Trailing backslash

Auto complete works up until /Gamgrep (supposed to be Game) Then if I go to the directory my iso are stored.

mular@AlphaLinux:~$ cd /media/Local\ Disk/Games/Warcraft\ III/Warcraft\ III\ and\ The\ Frozen\ Throne/
mular@AlphaLinux:/media/Local Disk/Games/Warcraft III/Warcraft III and The Frozen Throne$

Auto complete worked fine there..

If I just do: sudo W and tab it gives me Warcraft\ III\ -\ The\ Frozen\ Throne\ \[Disk - if I type 3 it completes it just fine..
mular@AlphaLinux:/media/Local Disk/Games/Warcraft III/Warcraft III and The Frozen Throne$ sudo Warcraft\ III\ -\ The\ Frozen\ Throne\ \[Disk3\].iso

Now.. as soon as I add the mount command and hit tab I get
mular@AlphaLinux:/media/Local Disk/Games/Warcraft III/Warcraft III and The Frozen Throne$ sudo mount Warcraft\ III\ -\ The\ Frozen\ Throne\ \[Disk3grep: Trailing backslash
grep: Trailing backslash

Hope this is helpful!

Revision history for this message
André Klitzing (misery) wrote :

It only happens if you use "sudo mount ...". If you use "mount ..." without "sudo" it will work properly.

I found a nice comment in /etc/bash_completion for that meta-commands like sudo (function _command).
-----
... currently not quite foolproof (e.g. mount and umount don't work properly), but still quite useful.
-----
I love those comments. ;-)

Matthias Klose (doko)
Changed in bash:
importance: Undecided → Low
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.