Sending a down arrow key through ksh - Aix

This is a discussion on Sending a down arrow key through ksh - Aix ; All, I have a KSH script which needs to navigate a menu automagically. Right now it does something like: echo "Y\nY\n..." | myprog > /logs/my.log The Y {enter} Y {enter} is answering prompts correctly in myprog, but right after that ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Sending a down arrow key through ksh

  1. Sending a down arrow key through ksh

    All,

    I have a KSH script which needs to navigate a menu automagically.
    Right now it does something like:

    echo "Y\nY\n..." | myprog > /logs/my.log

    The Y {enter} Y {enter} is answering prompts correctly in myprog, but
    right after that I am presented with a menu which I need to navigate
    using the arrow keys. This means sending a {down} {down}\n and then
    also sending the F10 key.

    Is there a way to echo arrow and function keys via a ksh script?


  2. Re: Sending a down arrow key through ksh

    Pete пишет:
    > All,
    >
    > I have a KSH script which needs to navigate a menu automagically.
    > Right now it does something like:
    >
    > echo "Y\nY\n..." | myprog > /logs/my.log
    >
    > The Y {enter} Y {enter} is answering prompts correctly in myprog, but
    > right after that I am presented with a menu which I need to navigate
    > using the arrow keys. This means sending a {down} {down}\n and then
    > also sending the F10 key.
    >
    > Is there a way to echo arrow and function keys via a ksh script?
    >

    A simple way for using arrow keys that `cat`.
    up - ^[[A down - ^[[B left - ^[[D right - ^[[C
    You can add this command symbols on vi/vim with pressing "Ctrl+V" and
    "[" and litera from [A-D].



    --
    UV-RIPE

  3. Re: Sending a down arrow key through ksh

    On Oct 12, 11:00*pm, Vladimir Usenko wrote:
    > Pete пишет:> All,
    >
    > > I have a KSH script which needs to navigate a menu automagically.
    > > Right now it does something like:

    >
    > > echo "Y\nY\n..." | myprog > /logs/my.log

    >
    > > The Y {enter} Y {enter} is answering prompts correctly in myprog, but
    > > right after that I am presented with a menu which I need to navigate
    > > using the arrow keys. *This means sending a {down} {down}\n and then
    > > also sending the F10 key.

    >
    > > Is there a way to echo arrow and function keys via a ksh script?

    >
    > * A simple way for using arrow keys that `cat`.
    > up - ^[[A down - ^[[B left - ^[[D right - ^[[C
    > You can add this command symbols on vi/vim with pressing "Ctrl+V" and
    > "[" and litera from [A-D].
    >
    > --
    > UV-RIPE


    Hmmm.....

    I've tried this both with the echo tactic described above and by using
    redirection like so:

    myprog < dosomething
    domorethings
    ^[[B
    ^[[B
    ^[[21~
    EOF

    So that's "do something", "do some more things", "down", "down", "F10"
    - but this it's just stopping after doing the second thing. No downs,
    no F10. Are there any other variables I need to set-up in order for
    redirection like this to acknowledge the escape sequence?

  4. Re: Sending a down arrow key through ksh

    "Pete" wrote in message
    news:345549b5-6248-4a37-953f-8bba5e1711f4@c36g2000prc.googlegroups.com...

    >So that's "do something", "do some more things", "down", "down", "F10"
    >- but this it's just stopping after doing the second thing. No downs,
    >no F10. Are there any other variables I need to set-up in order for
    >redirection like this to acknowledge the escape sequence?


    If you get nowhere, try "expect" - works quite well once you've learned how
    to drive it.

    cheers,
    clive



+ Reply to Thread