![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|