Operating System - HP-UX
1827809 Members
1943 Online
109969 Solutions
New Discussion

Re: recalling old commands

 
Chandrahasa s
Valued Contributor

recalling old commands

Hi Gurus,

Is there any way to recall old commands from other file??
Default when press esc+k old commands will be repeated by reading HISTFILE (file content)variable.
I want to get old command repeat without taking help of HISTFILE.


Chandra
4 REPLIES 4
Hakki Aydin Ucar
Honored Contributor

Re: recalling old commands

How will you get old commands without assistance of a file like .history recorded old commands ?
James R. Ferguson
Acclaimed Contributor

Re: recalling old commands

Hi:

You might try (temporarily) setting 'HISTFILE' to the filename you want to extract. This would at least assume that the alternate file had the same format as the normal history file. I have never tried this.

> I want to get old command repeat without taking help of HISTFILE

What problem are you attempting to solve?

Regards!

...JRF...
Raj D.
Honored Contributor

Re: recalling old commands

Chandrahasa s,

if you have already setup vi in .profile then "Default when press esc+k " you will see the old commands,

You can check:
# ksh -o vi
Esc k k k k ..... so on.


- To keep a record of the old file, you can implement HISTFILE with data and timestamp, by putting the code in users .profile


Also checkout few good links:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=722093

http://forums11.itrc.hp.com/service/forums/questionanswer.do?&threadId=901609




Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Dennis Handly
Acclaimed Contributor

Re: recalling old commands

>Is there any way to recall old commands from other file?

Nothing other than the obvious. You cut&paste commands from the other file.

Or you can add "echo" before each command, execute that file is a script, then you can get them from the $HISTFILE and remove the "echo".