Re: HP-UX 11.00 - cshell - history key (1018 Views)
Reply
Regular Advisor
Daniel Aquere de Olivei
Posts: 160
Registered: ‎08-01-2005
Message 1 of 7 (1,018 Views)

HP-UX 11.00 - cshell - history key

Hi,

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

Thanks.

Daniel
Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 2 of 7 (1,018 Views)

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
Please use plain text.
Honored Contributor
Jeff_Traigle
Posts: 1,354
Registered: ‎03-04-2004
Message 3 of 7 (1,018 Views)

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
Please use plain text.
Honored Contributor
V. Nyga
Posts: 4,874
Registered: ‎09-20-2002
Message 4 of 7 (1,018 Views)

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 ***
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,971
Registered: ‎03-06-2006
Message 5 of 7 (1,018 Views)

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.
Please use plain text.
Honored Contributor
Peter Nikitka
Posts: 1,575
Registered: ‎02-10-2003
Message 6 of 7 (1,018 Views)

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"
Please use plain text.
Honored Contributor
Rasheed Tamton
Posts: 965
Registered: ‎05-18-2002
Message 7 of 7 (1,018 Views)

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.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation