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.

when I perform an auto-completion of a bash variable an additional white space is added at the end.

$FO[TAB]

->

$FOO" " 

I added the quotes in order to denote the white space. The problem is that some variables we use are directories and the white space is annoying, since it has to be removed and a / has to be typed. Is it somehow possible to configure a behaviour like this

$FO[TAB]

->

$FOO/

or

cd $FO[TAB]

->

cd $FOO/

Best regards, Georg

share|improve this question

migrated from stackoverflow.com May 24 '13 at 20:43

This question came from our site for professional and enthusiast programmers.

    
You might want to see this: stackoverflow.com/questions/2339246/… –  devnull May 24 '13 at 8:19
    
There are several steps to consider: 1) Make $FO[TAB] complete to $FOO, 2) expand $FOO to its value, and 3) recognize that the value is a directory, and complete it with a trailing / and no space. 1) is the default, 2) can be accomplished with some readline settings and configuration. 3) is tricky, and will require at least some significant work with the programmable completion facilities. –  chepner May 24 '13 at 15:43

Your Answer

 
discard

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