LinuxQuestions.org
Visit Jeremy's Blog.
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 04-29-2013, 03:25 AM   #1
sivashank@gmail.com
LQ Newbie
 
Registered: Apr 2013
Location: Chennai
Posts: 5

Rep: Reputation: Disabled
Run and give input to parallel executing shell scripts from one another


i have a install script...

which needs input from user. i have another script which as all the inputs the first script need


how to run both of them paralleled. and provide values at run time..

Example....

a.sh needs input from user

b.sh has inputs....

a.sh need input from user after ten seconds

b.sh should provide it at ~10sec...


Note: i cannot modify a.sh...

b.sh can be modified...


Thanks for your help
 
Old 04-29-2013, 03:41 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,767

Rep: Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886
probably you can ask values in b.sh and use expect to pass them to a.sh
 
Old 04-29-2013, 03:46 AM   #3
sivashank@gmail.com
LQ Newbie
 
Registered: Apr 2013
Location: Chennai
Posts: 5

Original Poster
Rep: Reputation: Disabled
i want to learn the passing mechanism of values from one script to another... that runs parallel...


A.sh process some data.. and wait for user input...


i need to pass the value from another script when a.sh needs or ask...


Thanks for the help....
 
Old 04-29-2013, 07:21 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Your qn is a bit vague, but it sounds like you'll want the expect tool.
 
Old 04-29-2013, 07:36 AM   #5
sivashank@gmail.com
LQ Newbie
 
Registered: Apr 2013
Location: Chennai
Posts: 5

Original Poster
Rep: Reputation: Disabled
Is my question is not clear?

###################
a.sh - Note: i cannot modify this script
###################
sleep 10
read a
read b

c = a+b


####################
b.sh - i have values here
####################

a= 10
b= 20

i want to pass these values to script "a.sh" - on run time.. (b.sh - can be modified)


Thanks for helping

Last edited by sivashank@gmail.com; 04-29-2013 at 07:44 AM. Reason: Update
 
Old 04-29-2013, 07:56 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Yeah, use the expect tool to feed the answers; its what it was designed for.

eg http://stackoverflow.com/questions/4...to-ssh-command
man page http://linux.die.net/man/1/expect
 
1 members found this post helpful.
Old 04-29-2013, 09:10 AM   #7
sivashank@gmail.com
LQ Newbie
 
Registered: Apr 2013
Location: Chennai
Posts: 5

Original Poster
Rep: Reputation: Disabled
is 'expect' is default tool in UNIX?
 
Old 04-29-2013, 09:20 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,767

Rep: Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886
yes, it is more or less default. But as usual it depends on how the system was installed, it is not always installed by default
 
1 members found this post helpful.
  


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
[SOLVED] To give an input to a running process using shell scripts rohan511 Linux - Newbie 2 12-19-2012 08:10 AM
Parallel Shell scripts to execute using LAM?? vallme2003 Programming 6 03-12-2009 06:49 PM
How to execute two shell scripts in parallel Pavitra.v Linux - General 4 09-16-2006 06:59 AM
Executing Shell Scripts? l0f33t Linux - General 7 08-17-2003 04:36 PM
Executing shell scripts justinv Linux - General 6 01-26-2003 08:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:48 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