![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to monitor process running on server and posting a mail if any process is dead | pradeepmacha | Shell Programming and Scripting | 13 | 03-06-2009 07:33 AM |
| passing parameter from Shell-script to Sql-script | subodhbansal | Shell Programming and Scripting | 0 | 09-21-2007 07:15 AM |
| Parameter to script | mahabunta | Shell Programming and Scripting | 2 | 02-13-2007 05:33 PM |
| Urgent Need for Assistance: Triggering Windows bat files from UNIX | punyenye | Windows & DOS: Issues & Discussions | 0 | 03-16-2006 05:00 AM |
| triggering utility | hedrict | UNIX for Dummies Questions & Answers | 1 | 08-04-2002 04:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Triggering a Script Recursively With Different Parameter and in Different Process
Hi Every One
I have a Compilation Script name scomp which takes the Program name as the command line argument I have around 10000 Programs to compile while each program takes around 10 mins to compile i have written a Mass Compile script Scripts which takes the list of programs as input file and trigger the scomp for each Program in a for loop Now the Problem is until compilation for one program is not finished it does not start the compilation for the next Program in my Mass Compilation Script so to finish of all the 10000 Programs it take hell lot of time so Is there any way that i can Trigger the scomp simultaneusly for many Programs at a time so the the overall compilation time reduces like creating one more process?? my Mass Compile Script is some thing like this echo 'Enter file with list of programs : 'read INPUT for I in $(cat $INPUT) do echo ${I} /home/aixuser/scomp ${I} done I want to do this simultanesly for Programs given in Input file... |
|
||||
|
You have two possible solutions....
1) /home/aixuser/scomp ${I} & This will run your command in the back ground then continue with execution of the script. Problem - If you log out of the system the back ground jobs will die! 2) nohup /home/aixuser/scomp ${I} & This will run your command in the back ground and if you log out of the system the back ground processors will NOT DIE :-). Try it out first to see if thats what you need. |
|
||||
|
How can I can give input
Hi Andrek,
Your suggestion is nice. How can I give the input (if some script is required) for the background jobs?. The prompt will not be appear for the input. Quote:
|
|
||||
|
Quote:
I dont think that solution would work basically the unit of operation (from the script) is individually not provided to the interpretor and we cannot expect it to run parallely ![]() Code:
>cat main.zsh
#! /bin/zsh
i=1
while [ $i -le 5 ]
do
# First modify the line as zsh print.zsh and run
# Next time modify the line as zsh print.zsh & and run
zsh print.zsh
i=$(($i + 1))
done
exit 0
Code:
>cat print.zsh
#! /bin/zsh
i=1;
while [ $i -lt 10 ]
do
echo "$i"
i=$(($i + 1))
sleep 1
done
exit 0
After you run the above and if satisfied how it works, modify the statement ( only ) where the actual compilation happens to a background job |
|
||||
|
Quote:
Hi Madhan Ya even when i try the Adrek concept i dont feel its running parallely I have Tried giveing 10 Programs and the Scripts just got finished echoing the all files names but if i look for the output files there are getting generated one by one only And is there any way i can see all the Back ground Process Running to make sure if its really running in Back Ground parallely?? |
|
||||
|
Quote:
Am really sorry I cannot understand the above, are you saying that its not running in parallel or is that you acheive the desired effect. Quote:
Code:
jobs Is that what you are looking for ? |
|
||||
|
Quote:
Code:
jobs shows no out put on my screen.. (to see all back ground Process) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|