I have a program (prog) that accepts a parameter in order to execute some internal loop grabbing memory in each iteration. I'm using top to monitor the memory usage and to produce an output.
Thus I need the program's pid as a parameter to top.
I capture pid using myPID=$!.
I'm also checking if the program returns an error code in order to stop the script's execution.
Now using & myPID always equals to 0 even if the program returns an error. Removing & error capture works fine but I have no pid.
Is there any work around in order to have error trapping and pid at the same time?
Hello
#!bin/ksh
sqlplus -s system/manager < |grep '^ORA' |uniq
select * from kk;
set echo on
show spool on
end;
/
EOF
save test.sh
sh test.sh
results
ORA-00942: table or view does not exist (3 Replies)
Hi Guys,
I was just wondering if anybody can help me with this problem.
OK, how we can get a value back from PL/SQL Script (not stored procedure/function)
See the below example: (for example aaa.sh)
#!/bin/ksh
VALUE=`sqlplus -s user/password@test_id <<EOF
@xxx.sq
EOF`
echo $VALUE
... (7 Replies)
Hi, I have written scritp which prints output from the executable to standard output as well as in a file. Here "add" is an c executable which returns
some value based on inputs.
But if tee is not used "$?" returns the return value from add exe.
If tee is used it is simply retuning 0.
echo... (5 Replies)
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
I have a K shell script (ksh) that needs to return an email address. A C program was written (prog1) to now access the email address off of an oracle table. The call to the program in the ksh is
prog1 -p parm1
Based on Parm1 the program will read an oracle table and retrieve the email... (2 Replies)
Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Tried to add a function to my control_c interrupt here. It works but has one little bug. If the user selects to run the function instead of exiting, the program restarts itself without forking as it should. However, after that control_c no longer works again. I wanted to allow the user to run... (1 Reply)
i have the follow shell script that try to find any file in the specified path and upload to oracle.
if no file will output in the concurrent log and the program return as error , how do i change the program so that if no file found will give out normal sucessful result.
i tried change the exit... (3 Replies)
I am trying to reverse complement DNA sequence (string) with a short c++ code using boost library. Code was compiled without any warning/error, but ran into Segmentation fault.
My guess is the function to return a vector, but not sure.
#include <iostream>
#include <fstream>
#include <string>... (14 Replies)
I have the following code in a script:
find . \( ! -name . -prune \) -name "cg*" -exec cp -p {} "${temp_dir}" \;
ret_stat=$?
I think the return status is only captured for the 'find' command and not for the 'cp' command. Is there a way to get the return status for the 'cp' command... (7 Replies)
Discussion started by: vskr72
7 Replies
LEARN ABOUT DEBIAN
gearman::server
Gearman::Server(3pm) User Contributed Perl Documentation Gearman::Server(3pm)NAME
Gearman::Server - function call "router" and load balancer
DESCRIPTION
You run a Gearman server (or more likely, many of them for both high-availability and load balancing), then have workers (using
Gearman::Worker from the Gearman module, or libraries for other languages) register their ability to do certain functions to all of them,
and then clients (using Gearman::Client, Gearman::Client::Async, etc) request work to be done from one of the Gearman servers.
The servers connect them, routing function call requests to the appropriate workers, multiplexing responses to duplicate requests as
requested, etc.
More than likely, you want to use the provided gearmand wrapper script, and not use Gearman::Server directly.
METHODS
new
$server_object = Gearman::Server->new( %options )
Creates and returns a new Gearman::Server object, which attaches itself to the Danga::Socket event loop. The server will begin operating
when the Danga::Socket runloop is started. This means you need to start up the runloop before anything will happen.
Options:
port
Specify a port which you would like the Gearman::Server to listen on for TCP connections (not necessary, but useful)
create_listening_sock
$server_object->create_listening_sock( $portnum )
Add a TCP port listener for incoming Gearman worker and client connections.
start_worker
$pid = $server_object->start_worker( $prog )
($pid, $client) = $server_object->start_worker( $prog )
Fork and start a worker process named by $prog and returns the pid (or pid and client object).
SEE ALSO
gearmand
perl v5.10.1 2010-01-18 Gearman::Server(3pm)