1828225 Members
2329 Online
109975 Solutions
New Discussion

C shell features

 
SOLVED
Go to solution
PVR
Valued Contributor

C shell features

Hi Champs..

I need a small help.

In Linux if we use bash / C SHELL, we can get previous commands using arrow (up / down) keys.

But in HP unix it is not working for C Shell.

How can enable this feature. ????

Thanks in advance to each and everyone....
Don't give up. Try till success...
5 REPLIES 5
Shaikh Imran
Honored Contributor

Re: C shell features

Hi,
This is called as command line editing feature.
This is not supported by c shell but by K shell in hp-ux.
To achieve this feature in HP-UX we have to use.
#ksh -o vi
After this you can view all the previous commands and run them.You have to move forth and back in this by using the same keys as we use in vi.
E.g.
esc k will show you the earlier command you can edit this command by using normail h,j,k,l etc.., keys as we use it in vi.

To make this permanent put this entry in
.profile or /etc/profile files.

Regards,

I'll sleep when i am dead.
Muthukumar_5
Honored Contributor

Re: C shell features

Hai,

To get the previous commands,we have to enable the HISTORY. This history of commands started from C shell.

To enable the history ,use this.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=624933

We cannot use the up/down key on HP-UX. For that we have to use Esc k or
Esc\ enter then
key n or key N to UP and DOWN

Check this one.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=616828

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
Naveej.K.A
Honored Contributor
Solution

Re: C shell features

hi,

it can be set from the C shell prompt.

% set history=5

or you can set the history environment variable in the .cshrc file as
history=5

as far as the C shell is concerned, the features available in linux is available in HPUX also.

with best wishes
Naveej
practice makes a man perfect!!!
PVR
Valued Contributor

Re: C shell features

Thanks Naveej. it worked. Thanks to you all for the help
Don't give up. Try till success...
vasundhara
Frequent Advisor

Re: C shell features

Hi Naveej,

I am sorry to interfere. I am using HPUX 11i. I have tried the same command. It did not help me. I have added following lines in .cshrc file.

history=10

When I give csh, I got the following error.
root# # csh
history=10: Command not found.
root#