Unix Technical Forum

Sending a down arrow key through ksh

This is a discussion on Sending a down arrow key through ksh within the AIX Operating System forums, part of the Unix Operating Systems category; --> All, I have a KSH script which needs to navigate a menu automagically. Right now it does something like: ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-13-2008, 10:31 AM
Pete
 
Posts: n/a
Default 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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-13-2008, 10:31 AM
Vladimir Usenko
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-15-2008, 08:06 AM
Pete
 
Posts: n/a
Default Re: Sending a down arrow key through ksh

On Oct 12, 11:00*pm, Vladimir Usenko <mc2_...@radiocom.net.ua> 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 <<EOF
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-15-2008, 08:06 AM
Clive George
 
Posts: n/a
Default Re: Sending a down arrow key through ksh

"Pete" <peter.charbonnier@gmail.com> 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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads for: Sending a down arrow key through ksh

Thread Thread Starter Forum Replies Last Post
Control-C and up-arrow? Barry Burd OpenSSH 1 10-06-2008 05:10 PM
Down/Up Arrow in DOS window Krunoslav Malovic Tight VNC 0 10-06-2008 09:16 AM
Sending META key (was Re: Sending Option Key to OSX Server fromWin32 Client) Jonathan Gillaspie VNC 1 10-06-2008 07:07 AM
Re: One distributor is re-sending transactions another stops sending altogether. Walt SQL Server 0 02-28-2008 06:05 PM
One distributor is re-sending transactions another stops sending altogether. Walt SQL Server 0 02-28-2008 06:04 PM


All times are GMT. The time now is 04:50 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com