The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Trap key press in a script praveenbvarrier Shell Programming and Scripting 3 04-05-2008 05:56 PM
TheOnlin Backup.com Offers Customers Free Trial - The Open Press (press release) iBot UNIX and Linux RSS News 0 07-30-2007 01:30 AM
Parametric test systems make switch to Linux - Electronics Talk (press release) iBot UNIX and Linux RSS News 0 07-20-2007 02:30 AM
Print to Any Windows Printer from DOS, Unix, Linux, legacy ... - Press World (press r iBot UNIX and Linux RSS News 0 07-02-2007 08:50 AM
replace buttons with hyperlinks handshakeit Shell Programming and Scripting 1 10-13-2005 09:01 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-12-2007
Zelp Zelp is offline
Registered User
  
 

Join Date: Jun 2005
Location: Champaign, IL
Posts: 19
Make my script press buttons

I am having some problems trying to come up with way that my script can press <enter> for me.

I am surrounded by people who are not UNIX friendly, and I want my script to push Enter for me, without bothering the user to hit it.

Is that possible?
maybe with stty or something?

Been racking my brain on this, but can't figure it out. Any help is appreciated.
  #2 (permalink)  
Old 12-12-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by Zelp View Post
I am having some problems trying to come up with way that my script can press <enter> for me.
What is waiting for the <enter>?


Code:
echo "" | program-that-is-waiting-for-enter

or


Code:
program-that-is-waiting-for-enter <file-that-only-contains-a-newline

or


Code:
tell robotic-arm
     extend
     rotate left 90%
     down
     up
     rotate right 90%
     retract
end

  #3 (permalink)  
Old 12-12-2007
Zelp Zelp is offline
Registered User
  
 

Join Date: Jun 2005
Location: Champaign, IL
Posts: 19
well nothing is actually waiting for it.

I have a huge "select do case" statement. and each time after chossing one of the options, I want to clear the screen and automatically hit <enter> again to show the select options.

kinda lame, and not exactly required, but I am sure the end user will be much happier with it.

so I am trying to put this at the end of each case choice.

that robotic arm would be cool too, but I don't have a spare lying around
  #4 (permalink)  
Old 12-12-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by Zelp View Post
I want to clear the screen and automatically hit <enter> again to show the select options.
Do you mean ksh's select? If so that is the thing that is waiting for <enter>.

I thought the menu was always displayed before the prompt....
  #5 (permalink)  
Old 12-12-2007
Zelp Zelp is offline
Registered User
  
 

Join Date: Jun 2005
Location: Champaign, IL
Posts: 19
i guess the PS3 prompt is waiting.


Code:
PS3="Select the item number:"

because in a select command it just sits and wait for you to choose, so i want it to automatically hit <enter> right when it gets back to the PS3 prompt after completeing the previous selection. This way it displays the full list of choices again.
  #6 (permalink)  
Old 12-12-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Then do a break and get out then do the loop again...


Code:
while true
do
        PS3=......

        select ....... in .....
        do
               case "$REPLY" in ....
               ....
                      my long running thing
                      break;
               ....
               esac
        done
done

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0