LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2015, 10:08 PM   #1
quitus
LQ Newbie
 
Registered: Jan 2015
Posts: 8

Rep: Reputation: Disabled
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.
 
Old 01-03-2015, 10:29 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,506
Blog Entries: 6

Rep: Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421
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).

Last edited by astrogeek; 01-03-2015 at 10:32 PM.
 
Old 01-03-2015, 11:04 PM   #3
quitus
LQ Newbie
 
Registered: Jan 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
No, there is no ~/.inputrc, and $INPUTRC is defined nowhere
 
Old 01-03-2015, 11:16 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,506
Blog Entries: 6

Rep: Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421
Quote:
Originally Posted by quitus View Post
No, there is no ~/.inputrc, and $INPUTRC is defined nowhere
Then it is probably not being loaded.

Oh yes, welcome to LQ!
 
Old 01-04-2015, 01:18 AM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
/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.
 
Old 01-04-2015, 04:58 AM   #6
quitus
LQ Newbie
 
Registered: Jan 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
/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.
 
Old 01-04-2015, 12:27 PM   #7
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
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
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bash inputrc Question makeyourself Linux - General 2 12-31-2012 11:58 PM
.inputrc and readline key binding wmcase Programming 1 02-12-2010 12:33 AM
inputrc trouble Amicus Linux - Newbie 2 04-16-2006 08:04 PM
Global Values do not work in /etc/inputrc? Akhran Debian 1 09-14-2005 11:12 AM
inputrc vs profile calutateo Linux From Scratch 4 07-08-2005 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration