[Bash-completion-devel] Bug#560851: Bug#560851: bash-completion: completion doesn't works if file name has an apostrophe

Freddy Vulto fvulto at gmail.com
Sun Dec 13 21:39:28 UTC 2009

On 091212 20:38, skizzhg wrote:
> if I try with "ls" or "mv" then <TAB> to obtain the file list inside,
> it doesn't complete anything
> ~$ ls Pills\ \'n\'\ Thrills\ and\ Bellyaches/<TAB>

I think there's a bug in `compgen -f' if a directory contains a single
or double quote.  I asked the bug-bash mailing list, see:


We need to look into this and probably apply the workarounds below to

Excerpt from bug-bash mail:


So, these are the workarounds:

$ ls a\'b/  # For reference, works on both bash-3 & bash-4
$ compgen -f a\\\'b/   # Workaround for bash-4
$ compgen -f a\\\\\\\'b/   # Workaround for bash-3



Freddy Vulto

More information about the Bash-completion-devel mailing list