I have created some bash completion functions that all appear to work in isolation but give me unexpected results when I attempt to tab complete with them.

Is it possible to connect bashdb, then attempt to tab complete something and step through to debug and determine what is going wrong?

link|improve this question
2  
Just to add my to cents: you should use the set -x in bash to debug your scripts. Use set +x to disable. – hesse Jan 6 at 20:29
feedback

1 Answer

Just log / output from the bash completion functions; as they are most likely no rocket science, this should be fairly easy to do. It might be possible to connect bashdb, but it feels unnecessary...

link|improve this answer
Connecting bashdb would have been much simpler and, I expect, quicker than adding log statements to the scripts. However, I don't know if it is possible, and the lack of answers would suggest that it isn't. I managed to solve my problem by logging state to a file like you suggest, but outputting logging information to the terminal is not helpful when working with completions. – Dan Midwood Mar 26 at 20:53
3  
@DanMidwood: Use two terminals (e.g. screen + split). In one, run the completion, in the second, tail -f the log. – choroba Mar 30 at 14:13
@choroba: Nice one. :D – Tom Wijsman Mar 30 at 14:15
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.