Wednesday, December 07, 2011

Environment Variable Completion

I just noticed recently that the Bash shell does automatic environment variable completion. As with file name completion, hitting the tab key offers the rest of the possible completed values.

E.G. if I have these variables:

$ TB_THIS=somthing
$ TB_THAT=else
$ TB_OTHER=morestuff
Then I can type "echo $TB_" (without quotes) and then hit TAB twice, I see this output:
$TB_OTHER  $TB_THAT   $TB_THIS
As with file name completion, if I provide more letters, it auto-finishes the variable name.

Labels: ,

0 Comments:

Post a Comment

<< Home