1833777 Members
2213 Online
110063 Solutions
New Discussion

Command history

 
SOLVED
Go to solution
Juerg DENNEBERG
Advisor

Command history

Hi

as a "normal" user I am able to use "ctrl k" to repeat last commands.

Where do I have to edit what so I can use "ctrl k" also as "root" on a terminal session or on a "cde-session"

Many Thanks

Juerg
The personal liberty goes so far as it does not affect the liberty of others
7 REPLIES 7
Karthik S S
Honored Contributor

Re: Command history

Hi,

Root: Default shell is posix "sh" ... in root's home directory edit the .profile and set and export the shell to "ksh"

CDE: edit $HOME/.dtprofile

-Regards,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
twang
Honored Contributor

Re: Command history

Add the two entries in the root's .profile file:

export HISTFILE=/.sh_history
export HISTSIZE=100

then
# touch /.sh_history

relogin system.
It should works now.
Darren Prior
Honored Contributor
Solution

Re: Command history

hi Juerg,

Please don't change root's shell - it should always be left as sh otherwise you could run into some serious problems. Twang's answer is what you're looking for.

regards,

Darren.
Calm down. It's only ones and zeros...
Juerg DENNEBERG
Advisor

Re: Command history

Hi you all

I have to add:

login as root on a terminal session "esc k" works fine (I have to correct: in my first statement I should have written "esc k" instead of "crtl k". Sory)

Doing "su" to become root on a normal terminal session "esc k" does not work. I do not get any echo.

Typing "esc k" as root on cde I get the message: "/sbin/sh: ^[k: not found"

Thanks
The personal liberty goes so far as it does not affect the liberty of others
twang
Honored Contributor

Re: Command history

If you already put the 2 variables in .profile, remember to uncomment the line in .dtprofile and see if it works:
DTSOURCEPROFILE=true
Pete Randall
Outstanding Contributor

Re: Command history

Juerg,

When you su to root, no profile information is parsed unless you use the "su -" syntax, so you will have to do "set -o vi" manually. Either you need to remember to add tu "-" to your su command or remember to "set -o vi".


Pete


Pete
Juerg DENNEBERG
Advisor

Re: Command history

Hi you all

it works

Many thanks and have a nice weekend

Juerg
The personal liberty goes so far as it does not affect the liberty of others