10-16-2012
Quote:
Originally Posted by
codemaniac
the function is a recursive one (calls itself) hence you need a if condition in the function body so that it can be terminated when a certain condition is met(e.g when $c reaches a specific value).
@codemaniac, I think the OP knows that obvious fact. He is just asking for a way to stop the loop.
@Arun_Linux, I don't seem to be having any problem stopping the loop in bash 4.1 on cygwin using SIGINT.
10 More Discussions You Might Find Interesting
1. Solaris
Hi,
whenever I am giving a 'ls' command system is going into infinite loop displaying the current home directory.
There is no separate shell script/file with ls name anywhere in the system.
I am using Solaris 10.
Any help / guidance in solving this problem is highly appreciated.
... (3 Replies)
Discussion started by: umakant
3 Replies
2. Shell Programming and Scripting
Hi guys, I'm having a problem getting my infinite loop to loop. It simply reads in the users choice form the menu, executes the corresponding case statement and quits instead of looping back to the main menu again. I have a feeling it might be something with my if then statements within the case... (2 Replies)
Discussion started by: hootdocta5
2 Replies
3. Programming
Production C code compiled without the dash-g option is running, and seems to be in an infinite loop. Is there a way to tell? Is there a diagnostic tool that will report what objects or what lines of code or even what functions are being executed?
Or is my best option to kill it with a dump?
... (5 Replies)
Discussion started by: marcus121
5 Replies
4. Shell Programming and Scripting
hi all,
this is how my scrip looks like
#!/bin/sh
bindir='/opt/apps/script/bin'
datadir='/opt/apps/script/data'
dir='/opt/apps/script'
while : ; do
ls -1rt /opt/apps/script/data/check.txt*|tail -1 > /dev/null 2>&1
if ;then
chmod +rwx $bindir/dummy2.sh
... (8 Replies)
Discussion started by: tententen
8 Replies
5. Shell Programming and Scripting
what is the difference between while:,while true and while false? (6 Replies)
Discussion started by: proactiveaditya
6 Replies
6. UNIX for Advanced & Expert Users
I wanted to copy (not forward but copy) all incoming email to another address of mine. It worked, but now I encountered an infinite loop problem: When the second address doesn't like the content and bounces the message back, the bounce message will be sent back and forth.
So, what I have in... (1 Reply)
Discussion started by: distill
1 Replies
7. Shell Programming and Scripting
Hi All,
I need to run an infinite loop.
requirement below:
function1 --> creates a file file1
function2 ---> need to call if the file creates
i am running these both function via a script --> script.sh
i need to run the function1 first and if the file file1 creates then need to run the... (3 Replies)
Discussion started by: satyaranjon
3 Replies
8. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
My problem is an infinite loop when i press any other key other then Y or y in the while loop. what i want it to do is return to the normal script outside of it if pressing N or n or keep asking the same question if its any other... (4 Replies)
Discussion started by: Ren_kun
4 Replies
9. Shell Programming and Scripting
Hi, I was debating if I should put this in the dummies or scripts section, I apologize in advance if I chose poorly.
Fairly new to Unix and BASH scripting but I thought I made it fairly well given my limited understanding. However, the output indicates that it's looping and I'm ending up with a... (5 Replies)
Discussion started by: gotreef
5 Replies
10. Shell Programming and Scripting
I have a script script.shwhich is scheduled to run at 11 AM everyday.
# script.sh Code:
./scb_script.sh &
unfortunately scb_script.sh is running today in infinite loop as respective files are not available.
My question, when script.sh starts running tomorrow, will the old process be... (1 Reply)
Discussion started by: JSKOBS
1 Replies
EVSIGNAL(3) 1 EVSIGNAL(3)
The EvSignal class
INTRODUCTION
EvSignal watchers will trigger an event when the process receives a specific signal one or more times. Even though signals are very asyn-
chronous, libev will try its best to deliver signals synchronously, i.e. as part of the normal event processing, like any other event.
There is no limit for the number of watchers for the same signal, but only within the same loop, i.e. one can watch for SIGINT in the
default loop and for SIGIO in another loop, but it is not allowed to watch for SIGINT in both the default loop and another loop at the same
time. At the moment, SIGCHLD is permanently tied to the default loop.
If possible and supported, libev will install its handlers with SA_RESTART (or equivalent) behaviour enabled, so system calls should not
be unduly interrupted. In case of a problem with system calls getting interrupted by signals, all the signals can be blocked in an EvCheck
watcher and unblocked in a EvPrepare watcher.
CLASS SYNOPSIS
EvSignal
EvSignalextends
EvWatcher
Properties
o public$signum
Inherited properties
o public$is_active
o public$data
o public$is_pending
o public$priority
Methods
o public EvSignal::__construct NULL (int $signum, callable $callback, [mixed $data], [int $priority])
o finalpublicstatic EvSignal EvSignal::createStopped NULL (int $signum, callable $callback, [mixed $data], [int $priority])
o public void EvSignal::set (int $signum)
Inherited methods
o public int EvWatcher::clear (void )
o abstractpublic EvWatcher::__construct (void )
o public void EvWatcher::feed (int $revents)
o public EvLoop EvWatcher::getLoop (void )
o public void EvWatcher::invoke (int $revents)
o public bool EvWatcher::keepalive ([bool $value])
o public void EvWatcher::setCallback (callable $callback)
o public void EvWatcher::start (void )
o public void EvWatcher::stop (void )
PROPERTIES
o $signum
- Signal number. See the constants exported by pcntl extension. See also signal(7) man page.
PHP Documentation Group EVSIGNAL(3)