spartacus
6th March 2003, 09:40
I just tried to enter in my ".profile" the line "set -o vi" to activate the history. But it doens't work.
Is there a way, for a normal user to execute "set -o vi" automatically with every logon ?
Thanks
Spartacus
victor_cleto
6th March 2003, 14:06
ksh is enabled by default with vi mode.
Set also this in your .profile :
EDITOR=vi
HISTFILE=~/.sh_history
HISTSIZE=128
export EDITOR HISTFILE HISTSIZE
(This should be in the OS + DBs forum...)
ssbaan
6th March 2003, 15:35
If you add what victor_cleto suggests in the /etc/profile of the server, it will be efftective for all users and each should have their own history file in their home directory
spartacus
6th March 2003, 16:35
Is a new start of ksh enough to see the results ? Seems not to work for me??
I'm on Sun Unix
Spartacus
OmeLuuk
6th March 2003, 16:43
on Sun the set -o vi does not work... my home machine is not a sun, but when I am logged on and I need it: I start a separate shell with: ksh -o vi
sec... need to check I have one sun, where vi commands work fine... check this: cat .profile
set -o vi
...
This works for me on:
uname -a
SunOS hostname 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-Enterprise-10000
spartacus
6th March 2003, 17:01
I have a:
SunOS SMHG1BN1DB3 5.8 Generic_108528-11 sun4u sparc SUNW,Sun-Fire-280R
I entered "set -o vi" in ".profile". After that I started ksh new....
and it doesn't work for me :(
(If I type "set -o vi" direct on the prompt the histroy works fine :confused:
Spartacus
jaapzwaan
7th March 2003, 09:59
What if you do the following:
in .profile:
export ENV=~/.kshrc
and in ~/.kshrc:
set -o vi
Note that .profile is only executed when you log in and .kshrc is executed for every start of a new ksh.
Hope this helps,
Jaap Zwaan
b.v.dj
7th March 2003, 14:34
Hi,
I'v the following settings:
In the passwd file: /bin/ksh
In my homedir the file .sh_history exist!
(If I remove it, no new file is created. If I recreate it with > .sh_history, the history is being kept again after relogin.)
In my personal .profile:
set -o vi
And it works. Type <esc> on the prompt and you can "scroll" with k and j.