Operating System - HP-UX
1820072 Members
2541 Online
109608 Solutions
New Discussion юеВ

How do I create Shell Shortcuts

 
SOLVED
Go to solution
RAND IT Solutions
Contributor

How do I create Shell Shortcuts

Can someone tell me what goes
into my profile to get those
cool command line shortcuts
that do things like History
using Esc K to recall the
previously typed commands,
the way to get the hostname
to display at the shell
prompt and any other cool
things that are typically
seen on an HPUX box.

Thanks, Bill
6 REPLIES 6
Bruno Vidal
Respected Contributor
Solution

Re: How do I create Shell Shortcuts

Hi
First, this cool features depend of the shells.
csh, bash and other shell react differently. The ESC-k is a ksh/sh feature when HIST_FILE is defined. For the prompt it is defined by PS1 and PS2 variable. So I think you should take a look at man pages of your favorite shell (for myself it is bash).
Good luck.
Ken Hubnik_2
Honored Contributor

Re: How do I create Shell Shortcuts

Go out to this website and their are all kinds of sysadmin goodies. ftp://contrib:9unsupp8@hprc.external.hp.com
Bill McNAMARA_1
Honored Contributor

Re: How do I create Shell Shortcuts

try

set -o vi

it's a vi style prompt.

Later,
Bill
It works for me (tm)
RAND IT Solutions
Contributor

Re: How do I create Shell Shortcuts

That's all I should need.
I actually dug out my HPUX
manual from the dust and
realized there was a whole
chapter on it. You guys replied way too fast for me !
Thanks
Bill
T G Manikandan
Honored Contributor

Re: How do I create Shell Shortcuts

for command line history

set -o vi

for prompt
PS1=`hostname`@`logname`"#"

history

HISTSIZE=500
HISTFILE=.sh_history
export HISTSIZE HISTFILE


Stefan Schulz
Honored Contributor

Re: How do I create Shell Shortcuts

Hi,

regarding the histfile. Dont make the same mistake and store the histfile on a NFS mounted directory.

This works only 99% of the time. But suddenly your user just cant log in any more.

So this looks like:

HISTFILE=/tmp/.sh_history.$LOGNAME
export HISTFILE

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.