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
How to Control Cronjobs using Shell Script?? hanu_oracle Shell Programming and Scripting 8 03-18-2008 11:49 AM
Traffic Control Super Script 5.1.63 (Default branch) iBot Software Releases - RSS News 0 03-03-2008 05:10 PM
Traffic Control Super Script 5.1.59-alpha (Default branch) iBot Software Releases - RSS News 0 02-28-2008 04:20 PM
2 Questions about my process control script dkaplowitz Shell Programming and Scripting 3 04-13-2006 02:58 PM
using regular expressions in c shell control structure ballazrus Shell Programming and Scripting 3 02-20-2006 12:59 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-19-2007
JLJ JLJ is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 2
control over shell script

Hi..
I have a perl program that uses "system" to execute a shell script called startengine. The script "startengine" itself calls a lot of other smaller scripts to setup the engine etc. It finally has to execute ./engine which is another shell script which is long and takes a long time to complete processing.

The "startengine" script looks like this

#!/bin/bash
echo In shell script............
/usr/agjy/bin/cleartool setview $1 <<END

cd /vobs/eng/work
. ./setup host-dbg gw

cd \$ENG_TARGET_ROOT/home/bin
pwd

/home/agjy/bin/stopAll
/home/agjy/bin/cleanup

./engine 2>&1 |tee $2


My problem is that the system call returns back to perl script without waiting for ./engine to finish processing..
I have tried sleep in the perl script which works only sometimes depending on machine speed. Another problem is that ./engine is a waiting process- ie if it runs correctly it should say "waiting for connection.. " and wait for input. the output of ./engine is written into the logfile ($2). The perl script then parses that
logfile looking for the "waiting for connection" string and proceeds to send input to the engine or shut it down depending on if string was matched or not.

I need something that will make sure ./engine is completely processed before control returns to perl script..
I hope i have made the problem clear and would really appreciate any help with this..

Thanks,
JLJ
 

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 11:49 PM.


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