Operating System - HP-UX
1822194 Members
3896 Online
109640 Solutions
New Discussion юеВ

Re: add settings when log in

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

add settings when log in

I wanted to add "bash -o vi" to the .profile under root home directory, then when I log in, it will take effect, and I can use esc-k to search commands I typed. However, it won't work. What is the right way to do it in X window env.

thanks,
none
7 REPLIES 7
Rajeev  Shukla
Honored Contributor

Re: add settings when log in

What OS are you talking about? What version is it?
Coz i know there is no shell called as bash in HPUX, its in Linux

But well if you are trying so then just change the shell to bash and then execute
set -o vi

This will bring the history of the commands
Con O'Kelly
Honored Contributor

Re: add settings when log in

Hi

Add the following lines to .profile.

export EDITOR=vi
export HISTFILE=$HOME/.sh_history.

You should also be able to use set -o vi to turn on command history.

Cheers
Con
Hanry Zhou
Super Advisor

Re: add settings when log in

linux 7.2
it is runlevel 5, so Xfree86 window will be used. .profile won't be working, so any settings you add into the file won't take effect.

Why, and which file(s) I should be adding into?
none
Mark Grant
Honored Contributor
Solution

Re: add settings when log in

Hanry,

Just make sure you start up bash windows with the "-ls" flag. For example, if you use "xterm" for your window, run "xterm -ls" and set your "bash -o vi" in ".profile.

The "-ls" causes xterm/konsole/gterm etc to start up using a "log in" shell. This will read .profile.
Never preceed any demonstration with anything more predictive than "watch this"
Elmar P. Kolkman
Honored Contributor

Re: add settings when log in

You could also set a parameter in the .Xdefaults file or XTerm file in /usr/lib/X11/app-defaults to automatically start a loginshell when running a Xterm.

You could also add the commands to the .bashrc file in the homedirectory of the user. That file will be runned for every instance of bash...
Every problem has at least one solution. Only some solutions are harder to find.
Hanry Zhou
Super Advisor

Re: add settings when log in

.XTerm, .Xdefault, /usr/lib/X11/app-defaults, .Xsession... .X....
where is the best link I can surf to find out all these definitions, and configurations myself. LINUX.

Sounds very confusing.

Points will be followed soon.
thanks,
none
Mark Grant
Honored Contributor

Re: add settings when log in

A good starting point would be here

http://www.xfree86.org/
Never preceed any demonstration with anything more predictive than "watch this"