03-20-2008
Can you edit/re-submit with code tags?
Being able to see the script indented makes if - then - else and other stuctures easier to read and follow.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am running an Ubuntu Gutsy laptop with Advanced Compiz fusion options enabled. I am using xdotool to simulate keyboard input in order to rotate through multiple desktops.
I am looking for a way to kill a while true loop when the Enter key (or Control+C if it is easier) is pushed when the... (2 Replies)
Discussion started by: acclaypool
2 Replies
2. Shell Programming and Scripting
I wonder if someone could help me here. I am trying to find a way of exiting from a loop but not exiting me from the script for example
#!/bin/ksh
# ************* FUNCTIONS ******************
function1() { #ping test
ping $1 2 > /dev/null
if ; then
... (13 Replies)
Discussion started by: hcclnoodles
13 Replies
3. UNIX Benchmarks
Hardware Overview:
Model Name: Power Mac G5
Model Identifier: PowerMac7,2
Processor Name: PowerPC 970 (2.2)
Processor Speed: 1.8 GHz
Number Of CPUs: 2
L2 Cache (per CPU): 512 KB
Memory: 1.5 GB
Bus Speed: 900 MHz
Boot ROM Version:... (0 Replies)
Discussion started by: tnorth
0 Replies
4. UNIX for Advanced & Expert Users
Greeting,
The following script completes after reading only one record from the input file that contains many records. I commented out the "ssh" and get what I expect, an echo of all the records in the input.txt file. Is ssh killing the file handle?
On the box "uname -a" gives "SunOS... (2 Replies)
Discussion started by: twk
2 Replies
5. Shell Programming and Scripting
Hi my code looks like:
if test $STEP -le 10
then
.
.
ls -1d AM*-OUT|while read MYDIR
do
cd $MYDIR
ls |tail -n1| while read MYFILE
do
.
.
if test -s $MYFILE
then
sqlldr ....
rc=$?
if test $rc -ne 0 (3 Replies)
Discussion started by: anijan
3 Replies
6. Shell Programming and Scripting
Hi,
I have a really simple script which I want to run forever, inside the loop it runs a C application which if it exits should restart.
#!/bin/sh
while true
do
./SCF scf.conf >> scf.log
sleep 2
done
For some reason the SCF C application coredumps and the script is exiting.... (3 Replies)
Discussion started by: marvinwright
3 Replies
7. Shell Programming and Scripting
Hi I am having a problem exiting a WHILE loop. I am on a Sun server using ksh.
I am running a Veritas Cluster Software (High Availablity) command to obtain a group status and grepping the command output for status "G" which means that the filesystem is frozen and therefore not available to... (3 Replies)
Discussion started by: bigbuk
3 Replies
8. Shell Programming and Scripting
We are trying to design a flow so that an ETL job shouldn't start until the previous job completes. The script we have written is
while ; do sleep 2; done
The loop however exits even when the process is actually running. Why could this be happening? (12 Replies)
Discussion started by: jerome_rajan
12 Replies
9. Shell Programming and Scripting
Hi ,
I am processing some files using below shell script the problem for loop exit after processing some files even though it exist.After modifying file.txt and rerunning the script and its running .Any Advise
for i in `cat /xx/file.txt |tr -s "," '\n' ` ; do
echo $i... (3 Replies)
Discussion started by: mohan705
3 Replies
LEARN ABOUT DEBIAN
event::rpc::loop
Event::RPC::Loop(3pm) User Contributed Perl Documentation Event::RPC::Loop(3pm)
NAME
Event::RPC::Loop - Mainloop Abstraction layer for Event::RPC
SYNOPSIS
use Event::RPC::Server;
use Event::RPC::Loop::Glib;
my $server = Event::RPC::Server->new (
...
loop => Event::RPC::Loop::Glib->new(),
...
);
$server->start;
DESCRIPTION
This modules defines the interface of Event::RPC's mainloop abstraction layer. It's a virtual class all mainloop modules should inherit
from.
INTERFACE
The following methods need to be implemented:
$loop->enter ()
Enter resp. start a mainloop.
$loop->leave ()
Leave the mainloop, which was started with the enter() method.
$watcher = $loop->add_io_watcher ( %options )
Add an I/O watcher. Options are passed as a hash of key/value pairs. The following options are known:
fh The filehandle to be watched.
cb This callback is called, without any parameters, if an event occured on the filehandle above.
desc
A description of the watcher. Not necessarily implemented by all modules, so it may be ignored.
poll
Either 'r', if your program reads from the filehandle, or 'w' if it writes to it.
A watcher object is returned. What this exactly is depends on the implementation, so you can't do anything useful with it besides
passing it back to del_io_watcher().
$loop->del_io_watcher ( $watcher )
Deletes an I/O watcher which was added with $loop->add_io_watcher().
$timer = $loop->add_timer ( %options )
This sets a timer, a subroutine called after a specific timeout or on a regularly basis with a fixed time interval.
Options are passed as a hash of key/value pairs. The following options are known:
interval
A time interval in seconds, may be fractional.
after
Callback is called once after this amount of seconds, may be fractional.
cb The callback.
desc
A description of the timer. Not necessarily implemented by all modules, so it may be ignored.
A timer object is returned. What this exactly is depends on the implementation, so you can't do anything useful with it besides passing
it back to del_io_timer().
$loop->del_timer ( $timer )
Deletes a timer which was added with $loop->add_timer().
DIRECT USAGE IN YOUR SERVER
You may use the methods of Event::RPC::Loop by yourself if you like. This way your program keeps independent of the actual mainloop module
in use, if the simplified interface of Event::RPC::Loop is sufficient for you.
In your server program you access the actual mainloop object this way:
my $loop = Event::RPC::Server->instance->get_loop;
Naturally nothing speaks against making your program to work only with a specific mainloop implementation, if you need its features. In
that case you may use the corresponding API directly (e.g. of Event or Glib), no need to access it through Event::RPC::Loop.
AUTHORS
Joern Reder <joern at zyn dot de>
COPYRIGHT AND LICENSE
Copyright (C) 2002-2006 by Joern Reder, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2006-04-23 Event::RPC::Loop(3pm)