LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   who calls /etc/inputrc in centos 6.5? (https://www.linuxquestions.org/questions/linux-newbie-8/who-calls-etc-inputrc-in-centos-6-5-a-4175529966/)

quitus 01-03-2015 09:08 PM

who calls /etc/inputrc in centos 6.5?
 
hello, I am learning cenos 6.5 now and I am learning bash.
By google, I find that in /etc/profile, there should be this:
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

But I find no these line in my /etc/profle
after echo $INPUTRC, I find that it is empty.

Is it normal like this?
Thank you very much.

astrogeek 01-03-2015 09:29 PM

Disclaimer: I am not a CentOS user, so it is possible (but not likely) it does something strange... but...

From man bash:

Quote:

Readline Initialization
Readline is customized by putting commands in an initialization file (the inputrc file). The name of
this file is taken from the value of the INPUTRC variable. If that variable is unset, the default is
~/.inputrc. When a program which uses the readline library starts up, the initialization file is read,
and the key bindings and variables are set.
So if INPUTRC is not set a program that uses readline will try to load ~/.inputrc by default. Does ~/.inputrc exist? If so, does it load /etc/inputrc?

Otherwise, setting INPUTRC in /etc/profile is a common way of doing that, but it could be anywhere, or nowhere, along the initialization chain (see man bash: INITIALIZATION for how that works).

quitus 01-03-2015 10:04 PM

No, there is no ~/.inputrc, and $INPUTRC is defined nowhere

astrogeek 01-03-2015 10:16 PM

Quote:

Originally Posted by quitus (Post 5295059)
No, there is no ~/.inputrc, and $INPUTRC is defined nowhere

Then it is probably not being loaded.

Oh yes, welcome to LQ!

veerain 01-04-2015 12:18 AM

/etc/inputrc is used by readline package. It uses it to configure itself. And the line in /etc/profile should have export INPUTRC that is why echo outputs none.

quitus 01-04-2015 03:58 AM

Quote:

Originally Posted by veerain (Post 5295080)
/etc/inputrc is used by readline package. It uses it to configure itself. And the line in /etc/profile should have export INPUTRC that is why echo outputs none.

So it is not normal that there is no INPUTRC lines in the /etc/profile and I should add these myself? But why they are not included in /etc/profile? I just installed centos and did not do any change to any system file.

veerain 01-04-2015 11:27 AM

The readline library interprets the default file /etc/inputrc. So if that file is present, then no need to set a variable.

Read man page and info page for more info.

Code:

man readline
info readline



All times are GMT -5. The time now is 06:27 PM.