Sponsored Content
Full Discussion: control over shell script
Top Forums Shell Programming and Scripting control over shell script Post 302103544 by JLJ on Friday 19th of January 2007 06:55:24 AM
Old 01-19-2007
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
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Control Cronjobs using Shell Script??

Hi All, Now i am running the 3 oracle procedures one by one manually. Query: If 1st Procedure OUT_PUT is Success, then call 2nd Procedure. If 2nd Procedure OUT_PUT is Success, then call 3rd Procedure. If 1st Procedure is failed, then no need of calling the other ... (8 Replies)
Discussion started by: hanu_oracle
8 Replies

2. Shell Programming and Scripting

how to disable and enable <control>-c or -z in a shell script

Dear all, good day. i'm asking about how to disable <control>-c or <control>-z in the beginning of a shell script then enable it again before the script exit Best Regards ---------- Post updated at 04:41 AM ---------- Previous update was at 04:18 AM ---------- Dear All i found the... (3 Replies)
Discussion started by: islam.said
3 Replies

3. Shell Programming and Scripting

Control browser from shell script

I have a browser running in a separate virtual terminal and would like to be able to send shortcut codes (e.g. ctrl+A) to the browser (and have it react) from a bash script in a separate virtual terminal. I need to keep the script in the separate virtual terminal. (2 Replies)
Discussion started by: slak0
2 Replies

4. Shell Programming and Scripting

Version Control Through the Shell Script

Version Control Through the Shell Script Hi Guys, Apologize for the big request, please take some time and read it completely... This is Very important for me, and ur help is Very much Appriciated. I want to maintain the Version control to all my scripts running in Production server, I am... (6 Replies)
Discussion started by: Anji
6 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Removing control-m characters from shell script

Hi All, I need to remove control m character from a file. Steps which i am doing in shell script are: 1) We are comparing the header of the file to the database table header Here the file header has control-m characters. How do i remove it. Please help. Below are the steps i am using,... (12 Replies)
Discussion started by: abhi_123
12 Replies

6. UNIX for Dummies Questions & Answers

Deleting carriage control from shell script variable

I have a shell script variable called batch_id which contains the following value export BTCH_ID=`cat /TEMPDATA/jelg0100_batchid_sorted.dat` echo "BTCH_ID " = $BTCH_ID BTCH_ID = 1389428^ This variable can be 7, 8 or 9 digits long, so I must capture only the true numerical value. I am... (8 Replies)
Discussion started by: dgreene
8 Replies

7. Post Here to Contact Site Administrators and Moderators

Control - M Scheduler is not able to pick my shell script

Hi, Below is a shell script that i made:- #!/bin/ksh #path=/opt/tibco/shared/adaptadores/SSCC/EVEREST/input/ if ; then echo "ZIP Exists and now Processing" for files in /opt/tibco/shared/adaptadores/SSCC/EVEREST/input/T010B04.* do unzip $files echo "Files Unzipped" echo $files... (1 Reply)
Discussion started by: mmtrexon
1 Replies

8. Shell Programming and Scripting

Control - M Scheduler is not able to pick my shell script

Hi, Below is a shell script that i made:- #!/bin/ksh #path=/opt/tibco/shared/adaptadores/SSCC/EVEREST/input/ if ; then echo "ZIP Exists and now Processing" for files in /opt/tibco/shared/adaptadores/SSCC/EVEREST/input/T010B04.* do unzip $files echo "Files Unzipped" echo $files... (4 Replies)
Discussion started by: mmtrexon
4 Replies

9. Shell Programming and Scripting

Control m Character removal shell script

can anyone share script for how to remove control m character (1 Reply)
Discussion started by: pw227j
1 Replies

10. Shell Programming and Scripting

Passing control back to the shell script

Hi All, I have a shell script(test_abc.sh) with the following shell commands, which are invoking the same shell script with different parameters. test_abc.sh . ./test.sh abc >> test.log . ./test.sh xyz >> test.log . ./test.sh pys >> test.log . ./test.sh abc >> test.log . . ... (4 Replies)
Discussion started by: dev.devil.1983
4 Replies
xlator_call(8)						      System Manager's Manual						    xlator_call(8)

Name
       xlator_call - shell script to invoke PostScript translators

Syntax
       xlator_call datatype orientation pagesize width length indent

Description
       This  Bourne  shell script can be called by the line printer daemon to invoke the appropriate translator to convert each data type to Post-
       Script.	The data type passed by may be specified by using the command with the -Ddatatype option, or by using the  Da=datatype	capability
       in the file.

       For a file in a data syntax to be translated to PostScript, the script must contain a case branch which recognizes the data type string and
       calls a suitable filter.  The supplied recognizes the ANSI, ASCII, ReGIS and Tektronix 4014 data types.

Arguments
       datatype
       The valid data types are: or any other for which a translator has been installed.

       orientation
       The valid orientations are: portrait or landscape.

       pagesize
       The valid page sizes are: or

       width
       The width (in characters) of the page.

       length
       The length (in lines) of the page.

       indent
       The amount (in spaces) the output is to be indented.

       All the valid arguments are described in detail by the reference page.

Examples
       An example shell script is shown below:
       case $datatype in
       ansi)
	    exec ansi_ps -F $pagesize -O $orientation -e "$@";;
       ascii)
	    echo "(04) cvn {} def"
	    exec ln03rof -w$width -l$length -i$indent;;
       postscript)
	    exec cat;;
       tek4014)
	    exec tek4014_ps -F $pagesize -O $orientation;;
       regis)
	    exec regis_ps -F $pagesize -O $orientation;;
       *)
	    echo "$0: Translator for data type $datatype not installed" >&2
       esac

       When the shell script is called, the path searched is:
       /usr/local/lib/lpdfilters:/usr/ucb:/bin:/usr/bin:
				   /usr/lib:/usr/lib/lpdfilters

Files
       The				       script

See Also
       lno3rof(8), printcap(5), ansi_ps(8), lpd(8)

																    xlator_call(8)
All times are GMT -4. The time now is 07:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy