Behavior of Unix in calling 2 scripts simultaneously


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Behavior of Unix in calling 2 scripts simultaneously
# 1  
Old 02-17-2011
Behavior of Unix in calling 2 scripts simultaneously

Hi,

I wanted to know the exact behavior of the shell scripts in the below scenario.

I have 2 scripts - a.ksh and b.ksh
Both these scripts call a 3rd script xyz.ksh.
What will happen if both a.ksh and b.ksh run at the same time?
What will happen if a.ksh starts 2-3 seconds before b.ksh?
Note: xyz.ksh takes a lon time to run say 5 mins.

As per my understanding, both should work fine without any problem.
Also what will happen if both a.ksh and b.ksh are running from the same directory?

Thanks.
# 2  
Old 02-17-2011
It depends on what the scripts are doing. If you have multiple scripts running at the same time and working with and modifying the same resources, you will likely experience unpredictable behavior as they race against each other to get their jobs done.
This User Gave Thanks to alister For This Post:
# 3  
Old 02-17-2011
A race condition would be like, if they were trying to both write to the same file on disk simultaneously. Process 1 writes "hello", process 2 writes "world", you could get "helloworld", "worldhello", or maybe even "worhello"...

If they're just doing their own thing and not bothering each other they'll get along fine.
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 02-17-2011
Thnx alister n Corona688. This helps. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh behavior in scripts spawned w/nohup

I have a need to run any number of identical scripts simultaneously, so I've created a driver script which reads a template script, edits these appropriately and then submits them via nohup. The spawned scripts all check to see at some point how many of their number are running and once the count... (7 Replies)
Discussion started by: safedba
7 Replies

2. Shell Programming and Scripting

UNIX Solution - Calling SQL*Plus scripts

I have a requirement of bash shell script calling SQL*Plus script. Shell Script sqlplus <user>/<pwd> @sqlscript1 parameters sqlplus <user>/<pwd> @sqlscript2 parameters Now I need the values generated by sqlscript1 in sqlscript2. But it is more like a huge dataset in a table and not one... (7 Replies)
Discussion started by: uuuunnnn
7 Replies

3. Shell Programming and Scripting

Run 2 shell scripts simultaneously from one script

i Run 2 scripts on all of around 50 nodes every day. 1.Mod_1.sh 2.Mod_2.sh eg.. i run file with specific node no like Mod_1.sh NODE_(node number) Mod_2.sh NODE_(node number) I want to run both file by using single script with unique node number. Eg.. Mod_new.sh NODE_(node... (11 Replies)
Discussion started by: Ganesh Mankar
11 Replies

4. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

5. Shell Programming and Scripting

Calling scripts from with scripts

Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs. My first script monitors... (8 Replies)
Discussion started by: echoes
8 Replies

6. Shell Programming and Scripting

Calling oracle package Unix from shell scripts.

Hi, Can anyone tell me how to call a oracle package from a Unix shell script? I want to pass some input parameters to package and it will return me the output which I want to use further in my shell script. I want to know the way to capture the output values in my shell script. Please send some... (1 Reply)
Discussion started by: anil029
1 Replies

7. Shell Programming and Scripting

Calling scripts from other script.

I need to call 3 different shell scripts from 2 different scripts, one is a perl script and other is Shell script. In Case -1 : The perl script is myperlscript.pl and the name of three shell scripts which need to be called from the perl script are a1.sh, a2.sh and a3.sh. Each shell script... (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

8. Shell Programming and Scripting

Calling scripts within script

Hi, I have written a some six scripts to move large files and re-size them. This has been done step by step, taking backup, creating the new files, merging the files, removing the temporary files created. Since these files are around 500 MB, each step takes somewhere between 1 to 5 mins. ... (1 Reply)
Discussion started by: baanprog
1 Replies

9. Shell Programming and Scripting

To call many scripts from mother one simultaneously

Hi, I need to rin few other scripts from one main (mather) script. Working in ksh on LINUX. The only one condition - it should be run in parallel. I mean I have to be able to call 20 scripts from this mother script in parallel (start them in the same time). Does somebody know how to do it? ... (2 Replies)
Discussion started by: juliyp
2 Replies

10. Shell Programming and Scripting

Difference between calling the sub scripts

What is the difference between calling the sub scripts of below two line. /home/scripts/devdb.sh . /home/scripts/devdb.sh sh /home/scripts/devdb.sh We are using the suse 2.0 version (4 Replies)
Discussion started by: kingganesh04
4 Replies
Login or Register to Ask a Question