Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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. –  Herman Torjussen Jan 6 '12 at 20:29

1 Answer 1

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...

share|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 '12 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 '12 at 14:13
    
@choroba: Nice one. :D –  Tom Wijsman Mar 30 '12 at 14:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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