$ ulimit -c unlimited $ someapp Segmentation fault (core dumped) $ gdb `which someapp` c<TAB>awk: cmd. line:1: {if ($1 ~ /^`which awk: cmd. line:1: ^ unterminated regexp awk: cmd. line:2: {if ($1 ~ /^`which awk: cmd. line:2: ^ unexpected newline or end of string ore Bash completes core correctly but seems to have problems with `which someapp` Works well with other commands like $ ls `which someapp` c<TAB>ore /usr/bin/someapp core Reproducible: Always Steps to Reproduce: $ qpkg -I -nc -v bash app-shells/bash-completion-config-0.7 app-shells/bash-3.0-r7 app-shells/bash-completion-20041017-r2
It does this because the gdb completion function is expecting just the program name (it automatically prepends the path), and using a subshell confuses awk. If you are going to use gdb completion, do not use a subshell and which, but rather (to follow your example): gdb somea<TAB> co<TAB> In order for the executable to be in gdb's completion list it would need to be executable and in the current path (same requirements for which).