Operating System - HP-UX
1751963 Members
4819 Online
108783 Solutions
New Discussion юеВ

Re: HP-UX 11.00 - cshell - history key

 
Daniel Aquere de Olivei
Regular Advisor

HP-UX 11.00 - cshell - history key

Hi,

Please, how I configure arrows (up/down) for show the commands in history?

Thanks.

Daniel
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: HP-UX 11.00 - cshell - history key

Shalom Daniel,

Thats the way linux does it.

Been a while since I used c shell but I don't think it even keeps a keyboard history.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff_Traigle
Honored Contributor

Re: HP-UX 11.00 - cshell - history key

I haven't used csh in years either. I don't recall it using command history like Korn or POSIX shells. I think tcsh may have been able to do it, but not csh. If you look at the csh man page, it describes command history substitution and the history command, but no mention of scrolling through the history in any manner.
--
Jeff Traigle
V. Nyga
Honored Contributor

Re: HP-UX 11.00 - cshell - history key

Hi,

@SEP - of course does csh keeps it's history :-)

From 'man csh':
History Substitutions
History substitutions enable you to repeat commands, use words from previous commands as portions of new commands, repeat arguments of a previous command in the current command, and fix spelling or typing mistakes in an earlier command.

History substitutions begin with an exclamation point (!).

The number of previous commands saved is controlled by the history variable. The previous command is always saved, regardless of its value. Commands are numbered sequentially from 1.

You can refer to previous events by event number (such as !10 for event 10), relative event location (such as !-2 for the second previous event), full or partial command name (such as !d for the last event using a command with initial character d), and string expression (such as !?mic? referring to an event containing the characters mic).

These forms, without further modification, simply reintroduce the words of the specified events, each separated by a single blank. As a special case, !! is a re-do; it refers to the previous command.

'history' (or it's alias) show you the stored history, and with '!' you can execute the command with the no. .

As a special, you can use '^' to change the last command, so if your lsat command was 'ls', with ^s^l you'll get 'll' as the next command - of course you'll use that for longer commands.

But I've not yet seen, that csh works with arrows.
Then you should use 'bash' for example.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Dennis Handly
Acclaimed Contributor

Re: HP-UX 11.00 - cshell - history key

>Jeff: I think tcsh may have been able to do it, but not csh.

Right.

>Volkmar: But I've not yet seen, that csh works with arrows.

That's why I call it the scummy csh. Unless it can do vi (or emacs) editing, editing by sed like commands is next to useless.
Peter Nikitka
Honored Contributor

Re: HP-UX 11.00 - cshell - history key

Hi,

you have to use tcsh for this - the Tenex C-Shell is a superset of the old csh.
tcsh is available at the HP porting center.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Rasheed Tamton
Honored Contributor

Re: HP-UX 11.00 - cshell - history key

Hi,

You can install bash.
or
See the below thread

It talks about an alias option.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=3617

Regards,
Rasheed Tamton.