Pass parameters to a function and running functions in parallel
Hi ,
I have a script which is using a text file as I/P.
I want a code where it reads n lines from this file and pass the parameters to a function and now this script should run in such a way where a function can be called in parallel with different parameters. Please find below my script, it is actually loading tables:
Please check where am i going wrong.
full_refresh.txt: input file
here i tried using split command to read 4 lines at once.
Thanks a lot in advance
Last edited by Ravindra Swan; 11-19-2013 at 03:12 AM..
Reason: Small change in script
All,
I have a sh script of the following tune:
function a () { #functionality.. }
function b () { #functionnlity.. }
function check () { # this function checks for env and if all fine call build }
function usage () { #sh usage details }
function build () { #calls either a or b or... (5 Replies)
i have script say some_script.ksh that takes an argument
I need to run some_script.ksh in background parallely at the sametime with different arguments.
Once all the background jobs complete, i need to run this script again in parallel with another 5 set of arguments.
Would really... (1 Reply)
Hi I have 2 files a.c and a.bak where I changed long to int using awk script.
I want to get the list of functions whose parameters got modified
for eg: fun ( long a, long b ) might be changed to fun ( int a, int b ) (1 Reply)
Hi,
Please help me with the below situation where I have to handle the parameters passed to a function in a unique way.
Below is the code, which I am trying to execute. I basically want to pass the parameter to a function, where I am trying to get user input into array(s). I want to name... (7 Replies)
Hi, for example I have this function:
function get_param ()
{
test=echo "some string"
test2=echo "someother string"
}
I want to call this function and get test or test2 result, how do I do that ?
Thank you (2 Replies)
Hello,
I have multiple functions within a shell script. eg. function_database_backup, unix_tar_creation, etc.
I would like to run these functions in parallel, as each is independent of the other.
If these were simple commands, I could have probably run each of the commands in background.
... (1 Reply)
I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line
if
then... (8 Replies)
I have a script (ksh) which tries to run a function in parallel for performance gains. I am also trying to limit the number of parallel child processes to avoid overloading the system by using a variable to count triggered processes and waiting for completion e.g.
do_something ()
{
...
}
... (9 Replies)
Hi,
I am a beginner in python programming. In my python script have a main function which calls several other functions. The main function gets its input by reading lines from a input text file. I call the main function for every line in input text file through a loop.
def main(line):
var1... (6 Replies)
Hi Experts,
how to pass subject,mailbody and filename as parameters to function.
mode=$1
file=/db/files/uniq.txt
mail_send() {
export MAILPART=$(uuidgen)
export MAILPART_BODY=$(uuidgen)
{
echo "TO:nalu.d@hes.com"
echo "Subject:$subject"
echo "MIME-Version: 1.0"
... (0 Replies)
Discussion started by: nalu
0 Replies
LEARN ABOUT DEBIAN
alzabo::faq
Alzabo::FAQ(3pm) User Contributed Perl Documentation Alzabo::FAQ(3pm)NAME
Alzabo::FAQ - Frequently Asked Questions
How can I generate the SQL to turn one schema into another?
Assuming you have schema objects representing these already created (through reverse engineering for example) and both schemas are for the
same RDBMS, you can simply do this:
my @sql = $schema1->rules->schema_diff( old => $schema1, new => $schema2 );
The @sql array will contain all the SQL statements necessary to transform the schema in $schema1 into the schema in $schema2.
If you want to sync a schema object to the current state of the RDBMS backend's schema, check out the "Alzabo::Create::Schema->sync_back-
end" method.
How can I make a local copy of the documentation as HTML?
Alzabo comes with a script called "make_html_docs.pl". It takes three arguments. The first is the source file directory root. The second
is the target directory. The last is the absolute URL path that this target directory represents. If you have perl 5.6.0 or greated
installed, it is recommended that you use it to run this script as the Pod::Html module included with more recent Perls does a much better
job of making HTML.
If you were in the root of the source directory you might run this as:
perl ./make_html_docs.pl ./lib /usr/local/apache/htdocs/Alzabo_docs /Alzabo_docs
The script will create an index.html file as well as turning the documentation into HTML.
How can I optimize memory usage under mod_perl?
You should simply preload the Alzabo::Runtime module (which loads all the other modules it needs).
In addition, if you are using Alzabo::MethodMaker, make sure it runs in the parent. This module can create a lot of methods on the fly and
each method eats up some memory.
Finally, you can preload one or more schema objects. The easiest way to do this is to simply pass its name to Alzabo::Runtime when you use
it, like this:
use Alzabo::Runtime qw( schema1 schema2 );
How can I get objects for tables linked via the Mason GUI?
For example, if I have a websites2categories table which maps a list of categories that a given web site should display -- and uses
website_id and category_id in a 1..n relationship -- what is the proper way to set that up in the GUI and then in my code?
In the GUI, you can simply create a relationship from websites to categories, and declare it n..n. Alzabo will automatically create a ta-
ble called websites_categories, and you're free to change the name to whatever you want.
Then if you use "Alzabo::MethodMaker", Alzabo will see that you have a table with 2 cols, both of which are part of the PK, and that it has
1..n relationships with 2 other tables, and it will create the appropriate methods.
You can see what methods are being created by setting the "ALZABO_DEBUG" environment variable to "METHODMAKER" before loading Alz-
abo::MethodMaker. It'll spit everything out to STDERR. There's also the generated documentation, which is available via the
"docs_as_pod()" schema method after MethodMaker does its thing.
AUTHOR
Dave Rolsky, <autarch@urth.org>
perl v5.8.8 2007-12-23 Alzabo::FAQ(3pm)