LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-02-2010, 02:40 PM   #1
ckacosta
LQ Newbie
 
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0
Question Bash script help -- Script2 calls Script1 and supplies input to script1.


I have an app startup script that requires user input.

# start-app.sh
Enter PIN <user manually enters PIN here>
<app startup continues>

I want to write a second script that will call the first script, supply the input (PIN) automatically, then allow the first script to continue and start the app.

The problem is, I need script2 to give the PIN to script1 while script1 is running.

Is this possible?

Thanks
 
Old 11-02-2010, 03:21 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Yes. It could be done with "expect".
http://en.wikipedia.org/wiki/Expect

However, if script1 is really a script it might be simpler and better to modify it to accept the PIN as input at command line. It can be setup in such a way as to accept that at command line if given or if not to prompt the user as it does currently.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Escaping the parentheses characters in a bash script which calls find with -prune paul.richter Linux - Newbie 9 07-07-2010 09:59 PM
[SOLVED] How to make a bash script keep running in same terminal after it calls second script? JohnRock Linux - Newbie 4 06-25-2010 09:16 AM
a script calls another script which calls "bash" inside lordofring Linux - Software 10 03-18-2010 09:59 AM
Is 'nice' inherited to child processes? e.g. bash script/php script that calls MySQL SirTristan Linux - Newbie 1 12-04-2008 12:57 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:33 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
Open Source Consulting | Domain Registration