enable up key from keyboard to get last entered command during my script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcor
    New Member
    • Sep 2007
    • 63

    enable up key from keyboard to get last entered command during my script

    Hi, I have a script that ask several information to users and stores it in vars.

    I was wondering if it's possible to get the last information inserted by pressing the "up" key as we do in "normal" shell, while not running any script.

    Did I make my self clear?

    Does anyone know how to do this?

    thanks,

    João
  • Arepi
    New Member
    • Sep 2008
    • 62

    #2
    Hi, I dont understand exatly your problem

    You want add a subrutin to key "up", beetwen your script run and the read dont blocked the script ?

    Comment

    • Icecrack
      Recognized Expert New Member
      • Sep 2008
      • 174

      #3
      First off have you attempted this your self?

      second there is a way i know of that you can get it but please attempt doing this your self then we will help you,

      also it depends on the OS you are running from what i think you are using try:

      Code:
      history | less
      the history command in *nix.

      also posting your script may help users understand what you want.

      Comment

      Working...