How to run multiple instances of shell script in linux?

How we can run the multiple instances of the script? I need to run the script which I am calling from the below function.I can doit with cron but I don't want to put it in the cron.This cript dploy the build and here I want when the build stage then it should run with multilpe instances of colodeolpyall script where it finds the new.txt file ..

/mnt/projects/stp2perf2_app_runtime/lamb/current.txt
/mnt/projects/stp2perf2_app_runtime/orbitgw/current.txt
/mnt/projects/stp2perf2_app_runtime/stp/wsHUB/current.txt
/mnt/projects/stp2perf2_app_runtime/stp/wsSTP/current.txt
/mnt/projects/stp2perf2_app_runtime/stpbatch/current.txt
/mnt/projects/stp2perf2_app_runtime/stpmon/current.txt
/mnt/projects/stp2perf2_app_runtime/stpscripts/current.txt
/mnt/projects/stp2perf2_app_runtime/stptools/current.txt
/mnt/projects/stp2perf2_app_runtime/tag/current.txt
[stp@VHLDVW stp]$ find /mnt/projects/stp2perf2_web_runtime/* -maxdepth 2 -name current.txt -type f
/mnt/projects/stp2perf2_web_runtime/gdesksrv/current.txt
/mnt/projects/stp2perf2_web_runtime/gdesksrv_lgcy/current.txt
/mnt/projects/stp2perf2_web_runtime/gdesksrv_ungt/current.txt
/mnt/projects/stp2perf2_web_runtime/npg/current.txt
/mnt/projects/stp2perf2_web_runtime/stp/gwSTP/current.txt
/mnt/projects/stp2perf2_web_runtime/stpinbound/current.txt
/mnt/projects/stp2perf2_web_runtime/stpproxy/current.txt
/mnt/projects/stp2perf2_web_runtime/stpscripts/current.txt
/mnt/projects/stp2perf2_web_runtime/stptools/current.txt
/mnt/projects/stp2perf2_web_runtime/stpweb/current.txt

calldeploy()
   {
   cd /projects/stp/stpbuild/logs/BuildLogs/
   #Type=`grep "Build Type:" < ${LogFile} | awk -F"." '{print $NF}'`
   Type=`cat ${LogFile} | grep -o "Stage" | uniq`
   Pass=`grep "Result:" < ${LogFile} | awk -F"." '{print $NF}'`
   if [[ ${Type} == "Stage" && ${Pass} == "SUCCESSFUL" ]];then
   ssh -l stpuser VHLDVWSAD001 /projects/stp/stputils/deploy/colodeployall.sh &
   fi
   }
   calldeploy

Do you mind writing in plain English: I am puzzled with some of your words wondering if I have to understand typo errors or unix commands...

I mean I want to run the script multiple times in a single time

my script read the new.txt file and start the deployment i.e do all the joba and restart the servers
But I want if the script has read the new.txt file for one component and restarted the server It should pick the other new.txt for other compoenet and started the server.it should not wait for first that if the server started then will start for other.

Hope this clears

Well i am not 100% clear about what you want to do, but i think you want to read the "New.txt" file and then start all the jobs inside that file and restart the server (not sure which servers, may be mentioned in file??)

Pseudo code:

for config_file in `find . -type f -name current.txt`
do 
     <SCRIPT-TO-DO-DESIRED-THINGS> $config_file & 
done

Well not sure if this is what you are looking .. but looks like you want to run same script in parallel with different inputs

My script reads the new.txt file and then it check the name in new.txt file and deploy that on the enviorment and restart the nodes(only script does this)

My intention is if new.txt exist on 2-3 enviorments then my script should run in this way .i.e. script will run new.txt read it and start the nodes but it should not wait for the completion of restart all the node but read the next new.txt and restart that nodes...simillary for others

Hopes thi clears

Hi,

try with:

Can someone help to know about the multithreading process?