AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
Expand all | Collapse all

Script to store / recall commands

  • 1.  Script to store / recall commands

    Posted Mon October 05, 2009 11:16 AM

    Originally posted by: alexandre180


    Hi,

    I'm trying to write a script which could store and recall my commands on the command prompt. For example, it would look like that :
    script_recall "command to save" id (store my command with identifier id)
    script_recall id (recall and display my command on the prompt without executing it)
    command to save (on the command prompt)

    I manage to write a simple shell which echoes my commands but I have to copy/paste them on the command prompt.

    Any ideas to write such a shell ?

    Alex.
    #AIX-Forum


  • 2.  Re: Script to store / recall commands

    Posted Tue October 06, 2009 01:42 AM

    Originally posted by: SystemAdmin


    Hi,

    Look up how to activate the shell history. This should be do all that you need. We set the history variables in /etc/profile, so that it warks for all users; but you could do the same in your user ".profile".
    e.g.
    export EDITOR=/usr/bin/vi
    and possibly the HIST variables for even greater flexibility.
    #AIX-Forum