Home Man
Today's Posts

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

How to call exeute multiple bash shells from one master shell?

shell scripts

Login to Reply

Thread Tools Search this Thread
# 1  
Old 04-10-2018
How to call exeute multiple bash shells from one master shell?

I have few bash shells, which i want to run sequentially,

how to create a shell file, and execute/call one after other shell file. I am very new to shell programming. Bult some and running individually and also with crontab scheduler.

never had a shell calling other shells, kindly would like to know.

./master_shell.sh (this will be the master shell file)
so on so forth upto 8 shells.

Thanks a lot for the helpful info.
# 2  
Old 04-10-2018
Well, yes, list the shell scripts, preferably with absolute paths, one after the other in the master script to have them executed sequentially. Make sure you set permissions correctly. If unsure, make up a few simple test scripts and test your setup, e.g. with the -vx options set.
# 3  
Old 04-10-2018
In it's simplest form you would put one script after the other, it's best to use full paths to avoid the script failing if you aren't in the correct directory eg:



However typically you would want to check the exit status of each script and take appropriate action if this fails perhaps something like this:

if [ $? -ne 0 ]
     echo "Shell1.sh failed exit status was: $?" >&2
     echo "script terminated" >&2
     exit 1


Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to call Oracle function with multiple arguments from shell script? Balraj Shell Programming and Scripting 2 08-29-2016 02:28 AM
How can I replicate master master and master master MySQL databse replication and HA? Palak Sharma UNIX Desktop Questions & Answers 0 05-15-2014 01:15 AM
KSH - How to call different scripts from master scripts based on a column in an Oracle table Yoodit Shell Programming and Scripting 2 06-20-2011 07:39 AM
How to call multiple variables in bash !! gnanasekar_beem Shell Programming and Scripting 3 03-18-2011 01:51 AM
Differences in BASH and ASH shells regarding if command? Bashingaway UNIX for Dummies Questions & Answers 6 09-13-2010 05:33 PM
Bash shells communication alohisius Shell Programming and Scripting 4 09-21-2009 01:14 PM
Interacting with two BASH shells hresquivelo Shell Programming and Scripting 4 08-08-2009 06:37 PM
Shell script to call multiple java commands vivekdn Shell Programming and Scripting 4 09-03-2008 12:28 AM
Difference between ksh,bash and different shells. a25khan Answers to Frequently Asked Questions 5 12-10-2003 02:30 AM
BSD, Bash and Shells? RedVenim BSD 3 10-16-2003 09:59 AM

All times are GMT -4. The time now is 09:25 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password