11-24-2009
I see var set to zero before the internal until, I see limit set to $j, but nothing ever changes it -
You have two until's and one done. The code as shown can't be running - it would die with "syntax error: unexpected end of file"
10 More Discussions You Might Find Interesting
1. Programming
Hi all,
I am working on a c source code nearly 2000 line . it contains one big for( i=0; i< 200 ; i++ ) loop of around 600 lines
could any tell me how to break the execution of prog when the value of i is 50 in for loop so that i can check
inside the loop.
Thanks.. (1 Reply)
Discussion started by: useless79
1 Replies
2. UNIX for Dummies Questions & Answers
It is happening with my sessions already second time: a 'for'-loop for some reason stop to work as expected.
That means or it is looping without exitting, or it is not loop even once.
Here example of my try when it is not processing even one loop.
You can see, I start new subshell and... (14 Replies)
Discussion started by: alex_5161
14 Replies
3. Shell Programming and Scripting
Hi All,
I am comparing two strings inside an if condition if the strings are same then it should go inside the loop else it should execute code given in else part.
But there is a but inside my script
Even if the if condition is true
it is not going inside the loop also it is executing... (4 Replies)
Discussion started by: usha rao
4 Replies
4. Shell Programming and Scripting
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies
5. Shell Programming and Scripting
Hi everyone - just like to say great forum...I've learned a lot off here but I just can't figure this one out...(first post)
I'm writing a script to monitor a directory and email the latest modified file....(I realize there are better ways than I'm trying here...I don't like copying and pasting... (5 Replies)
Discussion started by: trevthefatty
5 Replies
6. Shell Programming and Scripting
I wonder how to stop further loop iterations when conditions gets false e.g.
This file.txt contains the following structure :
1
2
3
4
5
6
7
8
9
10
How to stop iteration when if statement gets false ?
for n in `cat file.txt`
do
if (( n<=5 )) (1 Reply)
Discussion started by: presul
1 Replies
7. Shell Programming and Scripting
Hey guys,
How do I make a loop that reads all the parameters en then stop when there are no parameters anymore ?
Something that gives an output like this:
./Script.sh parameter1 parameter2 parameter3
parameter = parameter1
parameter = parameter2
parameter = parameter3
Thanks a lot,... (5 Replies)
Discussion started by: Miki1579
5 Replies
8. Shell Programming and Scripting
Hi all,
i am trying to process a list of values in FILE like this:
aaa:bbb
ccc:ddd
eee:fff
With the following logic:
for INFO in FILE
do
export F1=`cut -f1,3,5,7 -d":" < FILE`
export F2=`cut -f2,3,5,7 -d":" < FILE`
ssh $F1 bash <<EOF
echo $F1
echo $F2
date (10 Replies)
Discussion started by: jonnyd
10 Replies
9. Shell Programming and Scripting
Im unable to stop the below infinite loop (bash script). Can someone tell me why this isnt responding to signals eg: ctrl+c (SIGINT) or ctrl+z
c=0
test_loop() {
c=$(($c+1))
echo "count value is : $c "
sleep 1
test_loop
}
Im using: SunOS 5.10
PS: If run this as... (13 Replies)
Discussion started by: Arun_Linux
13 Replies
10. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
LEARN ABOUT DEBIAN
mail::spamassassin::timeout
Mail::SpamAssassin::Timeout(3pm) User Contributed Perl Documentation Mail::SpamAssassin::Timeout(3pm)
NAME
Mail::SpamAssassin::Timeout - safe, reliable timeouts in perl
SYNOPSIS
# non-timeout code...
my $t = Mail::SpamAssassin::Timeout->new({ secs => 5, deadline => $when });
$t->run(sub {
# code to run with a 5-second timeout...
});
if ($t->timed_out()) {
# do something...
}
# more non-timeout code...
DESCRIPTION
This module provides a safe, reliable and clean API to provide alarm(2)-based timeouts for perl code.
Note that $SIG{ALRM} is used to provide the timeout, so this will not interrupt out-of-control regular expression matches.
Nested timeouts are supported.
PUBLIC METHODS
my $t = Mail::SpamAssassin::Timeout->new({ ... options ... });
Constructor. Options include:
secs => $seconds
time interval, in seconds. Optional; if neither "secs" nor "deadline" is specified, no timeouts will be applied.
deadline => $unix_timestamp
Unix timestamp (seconds since epoch) when a timeout is reached in the latest. Optional; if neither secs nor deadline is specified,
no timeouts will be applied. If both are specified, the shorter interval of the two prevails.
$t->run($coderef)
Run a code reference within the currently-defined timeout.
The timeout is as defined by the secs and deadline parameters to the constructor.
Returns whatever the subroutine returns, or "undef" on timeout. If the timer times out, "$t-<gt"timed_out()> will return 1.
Time elapsed is not cumulative; multiple runs of "run" will restart the timeout from scratch. On the other hand, nested timers do
observe outer timeouts if they are shorter, resignalling a timeout to the level which established them, i.e. code running under an
inner timer can not exceed the time limit established by an outer timer. When restarting an outer timer on return, elapsed time of a
running code is taken into account.
$t->run_and_catch($coderef)
Run a code reference, as per "$t-<gt"run()>, but also catching any "die()" calls within the code reference.
Returns "undef" if no "die()" call was executed and $@ was unset, or the value of $@ if it was set. (The timeout event doesn't count
as a "die()".)
$t->timed_out()
Returns 1 if the most recent code executed in "run()" timed out, or "undef" if it did not.
$t->reset()
If called within a "run()" code reference, causes the current alarm timer to be restored to its original setting (useful after our
alarm setting was clobbered by some underlying module).
perl v5.14.2 2011-06-06 Mail::SpamAssassin::Timeout(3pm)