Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I read on a blog somewhere about the possibility to use automatic history expansion before actually executing a command or even pressing the enter key in the command line. It involves the 'magic-space' and creating an ~/.inputrc configuration file.

What should that file contain exactly and when is it read (in login and non-login bash shells)?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Per the blog command you just need:

$if Bash
  Space: magic-space
$endif

The rest (the default settings) are sitting in /etc/inputrc.

This is read when GNU Readline (the input library Bash uses) is started. Because it's not directly part of Bash, reset and source ~/.bashrc et al won't work. To reload this without starting a new session, you need to run bind -f ~/.inputrc.

share|improve this answer
    
Very nice indeed. It works very well and makes the ~/.bashrc shell option -- shopt -s histverify -- redundant. Thank you. –  Cbhihe Jun 10 at 12:14
    
@Cbhihe Please accept the answer, if it helped you. –  PradyJord Jun 10 at 12:46

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.