LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-01-2009, 10:55 AM   #1
darak
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 0
Lightbulb Perl script: How to bypass prompt after issue a command?


Hi,
In Perl script, after I issue a command, I will get a prompt to answer either yes or no, how do I auto reply with my answer? Thanks in advance!
 
Old 05-01-2009, 11:02 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,343

Rep: Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909Reputation: 3909
Quote:
Originally Posted by darak View Post
Hi,
In Perl script, after I issue a command, I will get a prompt to answer either yes or no, how do I auto reply with my answer? Thanks in advance!
Uhh...why are you writing a script to prompt you for an answer, when you obviously already KNOW what you're going to type? Rewrite the script to use whatever answer you want, and not prompt you for it.

Or you can put a 'default' choice in the script, and have it auto-accept it after a certain amount of time 'paused'. Or you can run it via a shell script, using expect to automate it...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mandriva 2009.0 - How to bypass the initial registration/survey prompt? nyle Mandriva 3 01-29-2009 05:08 AM
How to bypass login: prompt after booting kernel and ramdisk janardhan@eilabs.com Linux - Security 1 02-29-2008 10:23 AM
nohup command in script doesn't return to system console prompt beammeup Linux - Software 4 02-05-2007 03:01 PM
command runs at prompt not in script newbie_m Linux - Newbie 2 01-20-2005 03:12 PM
Perl Script issue.... oicdn Linux - Software 2 03-24-2004 11:47 AM


All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration