Sponsored Content
Full Discussion: Run the for loop in parallel
Top Forums Shell Programming and Scripting Run the for loop in parallel Post 302855603 by jjoy on Friday 20th of September 2013 11:56:51 AM
Old 09-20-2013
Thanks Ahamad,
But this does not seem to be working for me. Please provide alternatives.
Looking to run the below in parallel on all databases, rather then one after one

Code:
for Db in `grep -v \# /etc/oratab|cut -d\: -f1|egrep -v "+ASM"`
do
export ORACLE_SID=$Db
sqlplus -s /nolog <<EOF
connect / as sysdba
startup
exit
EOF
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run processes in parallel?

In a korn shell script, how can I run several processes in parallel at the same time? For example, I have 3 processes say p1, p2, p3 if I call them as p1.ksh p2.ksh p3.ksh they will run after one process finishes. But I want to run them in parallel and want to display "Process p1... (3 Replies)
Discussion started by: sbasak
3 Replies

2. Shell Programming and Scripting

Run a command in parallel

Hi all, How do i run a command in parallel 50 times and capturing the result of each run in a separate file Eg: myApp arg1 > run1.txt myApp arg1 > run2.txt ::::::::::::::::::::::::: ::::::::::::::::::::::::: myApp arg1 > run50.txt The above way is sequential. ... (3 Replies)
Discussion started by: jakSun8
3 Replies

3. Shell Programming and Scripting

script - how to prevent in parallel run

I have one shell script which is being accessed by many jobs at same time. I want to make the script such that , other job should wait for the script if script is being used by some other job. Is there any way to implement it in script level ? Gops (1 Reply)
Discussion started by: Gopal_Engg
1 Replies

4. Shell Programming and Scripting

jobs run parallel - server consumption?

I have a requirement where jobs/scripts need to be run in the background.The concern here is there are around 20 scripts which need to be run in the bg.Does running all the 20 scripts/job at the same time in bg consumes much sever-utilization. If so wot would be the efficient way to run the jobs... (5 Replies)
Discussion started by: michaelrozar17
5 Replies

5. Shell Programming and Scripting

Run in series and Parallel

I have a list with four dates say load_date.lst contains 2010-01-01 2010-01-31 2010-03-01 2010-03-31 2010-05-01 2010-05-31 2010-07-01 2010-07-31 And I have directory /lll/src/sql with set of sql's 1_load.sql 2_load.sql 3_load.sql I want to run the sql'in series with respective to... (3 Replies)
Discussion started by: sol_nov
3 Replies

6. Shell Programming and Scripting

Run a script in parallel

Hey, I am new to UNIX scripting . I have script (ex: start_script) that starts a job in 10 different servers one server after another.Now I want to modify the script so that the script starts the job in all servers parallely (at a time in all servers).and I need the choice of selecting the... (3 Replies)
Discussion started by: mpspsm
3 Replies

7. Windows & DOS: Issues & Discussions

To run job in parallel in batch

Hi, I am using a batch file to run 2 or more shutdown batch for each of my server like below: Shutdown_serverA.bat Shutdown_serverB.bat ... Is there anyway i can do this in parallel instead of serially:confused: ServerA & ServerB shutdown at the same time in one click (batch). (4 Replies)
Discussion started by: beginningDBA
4 Replies

8. Shell Programming and Scripting

For loop in parallel

Hello, My script shell is: for i in $(seq $nb_lignes) do //command java done Please, how can i execute all iteration in parallel ? Thank you so much. (9 Replies)
Discussion started by: chercheur857
9 Replies

9. Shell Programming and Scripting

Run script in parallel in while loop

Hi I am running a loop which actually runs same script for different argument value passed to it. while read repID do echo "Starting for $repID"; date; perl process_report.pl $repID done<${FILE_TO_READ} However this runs in sequence. I want the loop to not to wait for perl to... (3 Replies)
Discussion started by: dashing201
3 Replies

10. Linux

Inconsistency with parallel run

Hi All, I am running a parallel processing on aggregating a file. I am splitting the process into 7 separate parallel process and processing the same input file and the process will do the same for each 7 run. The issue I am having is for some reason the 1st parallel processes complete first... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies
PROVE(1)						 Perl Programmers Reference Guide						  PROVE(1)

NAME
prove - Run tests through a TAP harness. USAGE
prove [options] [files or directories] OPTIONS
Boolean options: -v, --verbose Print all test lines. -l, --lib Add 'lib' to the path for your tests (-Ilib). -b, --blib Add 'blib/lib' and 'blib/arch' to the path for your tests -s, --shuffle Run the tests in random order. -c, --color Colored test output (default). --nocolor Do not color test output. --count Show the X/Y test count when not verbose (default) --nocount Disable the X/Y test count. -D --dry Dry run. Show test that would have run. --ext Set the extension for tests (default '.t') -f, --failures Show failed tests. -o, --comments Show comments. --fork Fork to run harness in multiple processes. --ignore-exit Ignore exit status from test scripts. -m, --merge Merge test scripts' STDERR with their STDOUT. -r, --recurse Recursively descend into directories. --reverse Run the tests in reverse order. -q, --quiet Suppress some test output while running tests. -Q, --QUIET Only print summary results. -p, --parse Show full list of TAP parse errors, if any. --directives Only show results with TODO or SKIP directives. --timer Print elapsed time after each test. --normalize Normalize TAP output in verbose output -T Enable tainting checks. -t Enable tainting warnings. -W Enable fatal warnings. -w Enable warnings. -h, --help Display this help -?, Display this help -H, --man Longer manpage for prove --norc Don't process default .proverc Options that take arguments: -I Library paths to include. -P Load plugin (searches App::Prove::Plugin::*.) -M Load a module. -e, --exec Interpreter to run the tests ('' for compiled tests.) --harness Define test harness to use. See TAP::Harness. --formatter Result formatter to use. See TAP::Harness. -a, --archive Store the resulting TAP in an archive file. -j, --jobs N Run N test jobs in parallel (try 9.) --state=opts Control prove's persistent state. --rc=rcfile Process options from rcfile NOTES
.proverc If ~/.proverc or ./.proverc exist they will be read and any options they contain processed before the command line options. Options in .proverc are specified in the same way as command line options: # .proverc --state=hot,fast,save -j9 --fork Additional option files may be specified with the "--rc" option. Default option file processing is disabled by the "--norc" option. Under Windows and VMS the option file is named _proverc rather than .proverc and is sought only in the current directory. Reading from "STDIN" If you have a list of tests (or URLs, or anything else you want to test) in a file, you can add them to your tests by using a '-': prove - < my_list_of_things_to_test.txt See the "README" in the "examples" directory of this distribution. Default Test Directory If no files or directories are supplied, "prove" looks for all files matching the pattern "t/*.t". Colored Test Output Colored test output is the default, but if output is not to a terminal, color is disabled. You can override this by adding the "--color" switch. Color support requires Term::ANSIColor on Unix-like platforms and Win32::Console windows. If the necessary module is not installed colored output will not be available. Exit Code If the tests fail "prove" will exit with non-zero status. Arguments to Tests It is possible to supply arguments to tests. To do so separate them from prove's own arguments with the arisdottle, '::'. For example prove -v t/mytest.t :: --url http://example.com would run t/mytest.t with the options '--url http://example.com'. When running multiple tests they will each receive the same arguments. "--exec" Normally you can just pass a list of Perl tests and the harness will know how to execute them. However, if your tests are not written in Perl or if you want all tests invoked exactly the same way, use the "-e", or "--exec" switch: prove --exec '/usr/bin/ruby -w' t/ prove --exec '/usr/bin/perl -Tw -mstrict -Ilib' t/ prove --exec '/path/to/my/customer/exec' "--merge" If you need to make sure your diagnostics are displayed in the correct order relative to test results you can use the "--merge" option to merge the test scripts' STDERR into their STDOUT. This guarantees that STDOUT (where the test results appear) and STDOUT (where the diagnostics appear) will stay in sync. The harness will display any diagnostics your tests emit on STDERR. Caveat: this is a bit of a kludge. In particular note that if anything that appears on STDERR looks like a test result the test harness will get confused. Use this option only if you understand the consequences and can live with the risk. "--state" You can ask "prove" to remember the state of previous test runs and select and/or order the tests to be run based on that saved state. The "--state" switch requires an argument which must be a comma separated list of one or more of the following options. "last" Run the same tests as the last time the state was saved. This makes it possible, for example, to recreate the ordering of a shuffled test. # Run all tests in random order $ prove -b --state=save --shuffle # Run them again in the same order $ prove -b --state=last "failed" Run only the tests that failed on the last run. # Run all tests $ prove -b --state=save # Run failures $ prove -b --state=failed If you also specify the "save" option newly passing tests will be excluded from subsequent runs. # Repeat until no more failures $ prove -b --state=failed,save "passed" Run only the passed tests from last time. Useful to make sure that no new problems have been introduced. "all" Run all tests in normal order. Multple options may be specified, so to run all tests with the failures from last time first: $ prove -b --state=failed,all,save "hot" Run the tests that most recently failed first. The last failure time of each test is stored. The "hot" option causes tests to be run in most-recent- failure order. $ prove -b --state=hot,save Tests that have never failed will not be selected. To run all tests with the most recently failed first use $ prove -b --state=hot,all,save This combination of options may also be specified thus $ prove -b --state=adrian "todo" Run any tests with todos. "slow" Run the tests in slowest to fastest order. This is useful in conjunction with the "-j" parallel testing switch to ensure that your slowest tests start running first. $ prove -b --state=slow -j9 "fast" Run test tests in fastest to slowest order. "new" Run the tests in newest to oldest order based on the modification times of the test scripts. "old" Run the tests in oldest to newest order. "fresh" Run those test scripts that have been modified since the last test run. "save" Save the state on exit. The state is stored in a file called .prove (_prove on Windows and VMS) in the current directory. The "--state" switch may be used more than once. $ prove -b --state=hot --state=all,save @INC prove introduces a separation between "options passed to the perl which runs prove" and "options passed to the perl which runs tests"; this distinction is by design. Thus the perl which is running a test starts with the default @INC. Additional library directories can be added via the "PERL5LIB" environment variable, via -Ifoo in "PERL5OPT" or via the "-Ilib" option to prove. Taint Mode Normally when a Perl program is run in taint mode the contents of the "PERL5LIB" environment variable do not appear in @INC. Because "PERL5LIB" is often used during testing to add build directories to @INC prove (actually TAP::Parser::Source::Perl) passes the names of any directories found in "PERL5LIB" as -I switches. The net effect of this is that "PERL5LIB" is honoured even when prove is run in taint mode. PLUGINS
Plugins can be loaded using the "-Pplugin" syntax, eg: prove -PMyPlugin This will search for a module named "App::Prove::Plugin::MyPlugin", or failing that, "MyPlugin". If the plugin can't be found, "prove" will complain & exit. You can pass arguments to your plugin by appending "=arg1,arg2,etc" to the plugin name: prove -PMyPlugin=fou,du,fafa Please check individual plugin documentation for more details. Available Plugins For an up-to-date list of plugins available, please check CPAN: <http://search.cpan.org/search?query=App%3A%3AProve+Plugin> Writing Plugins Please see "PLUGINS" in App::Prove. perl v5.12.5 2013-08-25 PROVE(1)
All times are GMT -4. The time now is 08:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy