Script calling another script not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script calling another script not working
# 1  
Old 01-09-2011
Script calling another script not working

Hi,

I'm new to this forum. I'm working on a Hyperion Essbase project and I'm responsible for the automation part of the piece. I am trying to execute 4 maxl script at the same time but it seem to be not working. Below is my script:
Code:
#!/bin/sh

# Maxl script to run
export MAXL_SCRIPT_1=/hyperion/..../script1.maxl
export MAXL_SCRIPT_2=/hyperion/..../script2.maxl
export MAXL_SCRIPT_3=/hyperion/..../script3.maxl
export MAXL_SCRIPT_4a=/hyperion/..../script4a.maxl
export MAXL_SCRIPT_4b=/hyperion/..../script4b.maxl
export MAXL_SCRIPT_4c=/hyperion/..../script4c.maxl
export MAXL_SCRIPT_4d=/hyperion/..../script4d.maxl
export MAXL_SCRIPT_5=/hyperion/..../script5.maxl

/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_1 "

wait
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_2 "

wait
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_3 "

wait
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_4a " &
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_4b " &
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_4c " &
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_4d " &

wait
/usr/bin/sh -c "cd /hyperion/...../bin/; ./startMaxl.sh $MAXL_SCRIPT_5 "

echo Done.

Seem that it will only execute only two of the scripts randomly. It would sometime execute 4a & 4d and so forth. I need to have the script execute 4a, 4b, 4c, & 4d at the same time and then it would execute script 5 once all the script 4s are complete.

Any information to why it is just executing only 2 scripts and not all 4 scripts would be helpful.

Thanks in advance,
Tim


Moderator's Comments:
Mod Comment Please use code tags when posting data and code samples, thank you.

Last edited by Franklin52; 01-09-2011 at 01:48 PM.. Reason: Please use code tags
# 2  
Old 01-09-2011
What shell are you using and why do you have to start the scripts in the manner that you are using?
# 3  
Old 01-09-2011
The reason i'm running this script in this manner because we are trying to have all the calculation scripts run in parallel. if we have each calculation script run in serial it will take over 14 hours. So, basically we split some 20 some script into 5 in each 4 different database and let them process we are hoping that this will cut down the time to process the calculation. i hope what i'm explaining makes sense.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

2. Shell Programming and Scripting

Calling shell script within awk script throws error

I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies

3. Shell Programming and Scripting

calling a shell script present on another server using perl script.

Hi, I am working on a sever A. I want to write a perl script to execute a shell script persent on the server B. please help me in this. thanks in advance. (3 Replies)
Discussion started by: anandgodse
3 Replies

4. Shell Programming and Scripting

How we can pass the argument when calling shell script from perl script

Can someone let me know how could I achieve this In one of per script I am calling the shell script but I need to so one thing that is one shell script call I need to pass pne argument.In below code I am calling my ftp script but here I want to pass one argument so how could I do this (e.g:... (5 Replies)
Discussion started by: anuragpgtgerman
5 Replies

5. Shell Programming and Scripting

Calling a Perl script in a Bash script -Odd Situation

I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell... (5 Replies)
Discussion started by: leepet01
5 Replies

6. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

7. Shell Programming and Scripting

ssh is not working while calling through expect shell script

Hi, Please share you experience and way out on below error:--> #!/bin/bash -xv FILE=login.txt + FILE=login.txt CONNECT=sshlogin.exp + CONNECT=sshlogin.exp SERVERNAME=$1 + SERVERNAME=192.168.12.1 MyServer="" + MyServer= MyUser="" + MyUser= MyPassword="" + MyPassword= exec 3<&0 +... (6 Replies)
Discussion started by: manish_1678
6 Replies

8. Shell Programming and Scripting

Running a unix script(which is calling another script inside that) in background

Hi all, I am having a script ScriptA which is calling a script ScriptB in the same server and copying files to second server and have to execute one script ScriptC in the second server. THis First script ScriptA is the main script and i have to execute this process continously. for Keeping... (2 Replies)
Discussion started by: rohithji
2 Replies

9. Shell Programming and Scripting

passing a variables value from the called script to calling script using ksh

How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ? I've given portion of the script here to explain the problem. Portion of Script 1 ============= ----- ----- tmp=`a.ksh p1 p2 p3` if then # error processing fi -----... (10 Replies)
Discussion started by: rajarkumar
10 Replies

10. Shell Programming and Scripting

calling current working dir from script

Hello, I am having problem in setting current working directory from shell. I want to set pwd as an environmental variable in a script. I am following an existing script which is defined as HOME=$(shell dirname `pwd`) C_HOME=$(shell echo $(HOME) | sed -e 's:\/:\\\/:g' ) But when I am trying... (3 Replies)
Discussion started by: chandra004
3 Replies
Login or Register to Ask a Question