LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 07-08-2005, 03:00 AM   #1
calutateo
Member
 
Registered: May 2004
Location: Spain
Distribution: SuSE9x
Posts: 40

Rep: Reputation: 15
inputrc vs profile


Dear all,

I downloaded the PenguinBrain-Shareware. One of the 201 questions is:

After experimenting with 'vi' as your command line editor, you decide that you want to have 'vi' your default editor every time you log in. What would be the appropriate way to do this?
- Change the '/etc/inputrc' file.
- Change the '/etc/profile' file.
+ Change the '~/.inputrc file.
- Change the '~/.profile file.

Can somebody explain why ~/.inputrc and not ~/.profile? In my opinion technically speaking it really doesn't matter.

Regards, Carsten
 
Old 07-08-2005, 04:22 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Change the '~/.profile file --> only if you need vi as default.
Change the '/etc/profile file --> only if EVERYONE need vi as default.

.inptrc file used by readline. See man page of readline for more info.
 
Old 07-08-2005, 04:38 AM   #3
calutateo
Member
 
Registered: May 2004
Location: Spain
Distribution: SuSE9x
Posts: 40

Original Poster
Rep: Reputation: 15
Dear nixcraft,

yes, the difference between e. g. /etc/profile and ~/.profile is clear to me.

However I cannot draw a conclusion from your answer.
Code:
root:~ # man readline
No manual entry for readline
root:~ # man -k readline
Term::ReadLine (3pm) - Perl interface to various *(C`readline*(C' packages. If no real package is found, substitutes stubs instead of basic functions.
Term::ReadLine::Gnu (3pm) - Perl extension for the GNU Readline/History Library
root:~ # rpm -q readline
readline-5.0-7.2
root:~ # rpm -ql readline-5.0-7.2
/lib/libhistory.so.5
/lib/libhistory.so.5.0
/lib/libreadline.so.5
/lib/libreadline.so.5.0
/usr/share/info/history.info.gz
/usr/share/info/readline.info.gz
No man page available, so I try the info page of readline.
Code:
 
root:~ # info readline
---snip---
1.3 Readline Init File
======================

Although the Readline library comes with a set of Emacs-like
keybindings installed by default, it is possible to use a different set
of keybindings.  Any user can customize programs that use Readline by
putting commands in an "inputrc" file, conventionally in his home
directory.  The name of this file is taken from the value of the
environment variable `INPUTRC'.  If that variable is unset, Readline
will read both `/etc/inputrc' and `~/.inputrc'.

   When a program which uses the Readline library starts up, the init
file is read, and the key bindings are set.

   In addition, the `C-x C-r' command re-reads this init file, thus
incorporating any changes that you might have made to it.

When a program which uses the Readline library starts up, the init file is read, and the key bindings are set.
---snip---
Very interesting but it doesn't provide an answer to my question, does it?

Regards, Carsten
 
Old 07-08-2005, 07:55 AM   #4
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Inputrc deals with the mapping of the keyboard. For example inputrc is used to customized Home, Del, Insert keys for BASH shell and readline is library used by bash and other shells. You should only include keyboard shortcut in this file. And your vi realted alias or EDITOR variable in profile file. You must be wondering then how it works if you include the line in INPUTRC .. that is because INPUTRC run as shell script by bash/your shell.

/etc/profile = The systemwide initialization file, executed for login shells FOR ALL USERS

~/.profile = The personal initialization file, executed for login shells for Individual/current logged in user.

/etc/inputrc = The systemwide readline initialization file for ALL USER

~/.inputrc = Individual readline initialization file


I hope this clears it.
 
Old 07-08-2005, 08:18 AM   #5
calutateo
Member
 
Registered: May 2004
Location: Spain
Distribution: SuSE9x
Posts: 40

Original Poster
Rep: Reputation: 15
Yes, that clears it.
Thank you, Carsten
 
  


Reply



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
non roaming profile on a roaming profile system fieldyweb Linux - Newbie 1 10-03-2005 12:27 PM
Global Values do not work in /etc/inputrc? Akhran Debian 1 09-14-2005 10:12 AM
creating /etc/inputrc file in Chapter 7.7 chakkaradeepcc Linux From Scratch 2 05-13-2005 06:42 AM
profile help jalburger Linux - Newbie 3 07-10-2002 10:54 AM
/etc/profile flex411 Linux - General 7 05-11-2001 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:12 PM.

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
Open Source Consulting | Domain Registration