I write this config file:
# ~/.inputrc Control-d: "\C-udate +'%F %T'\C-m"
I want to run
date command when I type Ctrl-d.
But I cannot override the default behavior(
Thanks for your help.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
If you do
stty -a, you'll notice that Ctrl-D is bound to
eof (end of file) for the terminal driver. You would have to unbind it using
stty before the Bash binding would have any affect. I wouldn't recommend that you do that. It would be better to choose another keystroke. I use Alt-Shift-D for a similar purpose.
"\eD":"date +%A,\ %B\ %-d,\ %Y,\ %-l:%M:%S\ %p,\ %Z\ \(UTC%z\)"
I think that the line discipline trumps readline. Try executing
stty eof undef