Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have n files and each file has 5-6 .sql files.Now I need to wrie a shell script that executes all the n files in parellel and for each n file the .sql files sequentially.eg
nope...i think i did not explain my question clearly.I need to run the CRM ,CM and AP in parellel and all the sqls under each sequentailly.I think i need to create child processes....please help...
Sorry, I still have no idea what you're trying to do there. How do you normally
"run" your CRM, CM and AP files? How do they relate to the sql files (apart from
the obvious names)?
the ARM,CM etc are module names under which there are n sql files that need to be executed.suppose the ARM module has 5 sql files then these 5 sql files would get executed sequentially but the modules should run in parellel.i have been able to write the script for one module.the sql files are running sequentially but now i ve to make the sql files in other modules run in parellel.i know i can establish it by forking the child process but since i ve just started unix i ve not reached that level.please help.the code written till now is:
while read temp_file3_line
do
string=$temp_file3_line
module_name="$(echo $string | cut -d '_' -f 2)"
echo $temp_file3_line >> "${module_name}_SQL_LIST.sql"
done <temp_file3
. DBSQLExecute
while read line
do
VAR1=$line
echo calling function
SQL_CONN_CODE="sa/sa@conCRM5"
#. DBSQLExecute
DBSQLExecute $VAR1 $SQL_CONN_CODE
#DBSQLExecute sa sa conCRM5 ARFB_CRM_5106.sql
echo returned from function
the function is as:::::::
#!/bin/sh -vx
echo inside DBSQL
DBSQLExecute()
{
echo value of 1 is $1
echo value of 2 is $2
echo $$ >sql.pid
cd ARFB
#sqlplus -s ${SQL_CONN_CODE} < $1
sqlplus -s $2 < $1
echo connected
sleep 5
}
~
~this code is running 5 .sql files in one module.there are 8 other modules like this and under each module there are 6-9 .sql filesto be run sequentially.i hope i ve been clear.please guide!!!!
~
~
I'm still not sure about that "in parallel" part. You have no guarantee
that the jobs will all run the same time; so it's quite possible that
the list of 6 ARMs completes before the 5th CM has been started.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.