Hi all,
I'm having problems with the setting a variable in a nested if statement. It doesn't seem to change even if it mets the 'if' condition.
My script essentially looks for a user name from the output from a kerberos command.
When I find the user name, I tried to change a variable and exit... (6 Replies)
Hello I have some nested loop to display files and form menu item.
The part of the code is below.
I found that after runnining the script for a while the display becomes very slow.
Does ksh shell provided any easy way to release variables, reinit, etc.
while ];do
script=0
... (2 Replies)
Hi,
I have the following script which is two while loops, but it is working only for the Inner loop without going back to the outer loop.
the aim of this script is to remove data files from memory after each five times for each setting of the rotate parameter
#!/bin/csh
set hdir =... (1 Reply)
Hi,
How to use values in one for loop to other for loop.
say "$sf_rel" variable has values "2011/W2 2011/G2" I want to use these values in inner for loop to process properly.
$branch variable has G2 and 6
What is happening is outer for loop $i has 2011/W2 it is entering into inner... (3 Replies)
Greetings,
Would anyone be able to tell me why this nested loop doesn't seem to work in any variation?
for i in {1..8}
do
echo "i is "$i
for j in {1..i}
do
echo "j is "$j
done
doneoutput is always along the lines of
i is 1... (7 Replies)
Hi All,
Need help on below script
for g in `cat /home/sid.txt`
do
for h in `cat /home/dev.txt`
do
symmaskdb -sid $g -dev $h list assign |grep FA |head -1|awk '{print $2}' > tt1.txt
done
done
cat /home/sid.txt
**************
123
235
456 (5 Replies)
I have a MPI program like this:
void slave1(int j){
MPI_Status status;
MPI_Recv(&j,1,MPI_INT,0,0,MPI_COMM_WORLD,&status);}
void slave2(int j){
MPI_Status status;
MPI_Recv(&j,1,MPI_INT,0,1,MPI_COMM_WORLD,&status);}
int main(int argc, char *argv){
int numprocs, rank;
... (0 Replies)
I am using the following nested loop
for i in {1..3}
do
for y in {1..3}
do
if ;
then
echo P0${i}R${y}.fas
mv P0${i}R${y}.fas P${i}R${y}.fas
read -t 5
fi
done
done
I was wondering if I can use a character such as * or ? instead of my second variable y. I tried R in... (3 Replies)
Discussion started by: Xterra
3 Replies
LEARN ABOUT DEBIAN
io::async::test
IO::Async::Test(3pm) User Contributed Perl Documentation IO::Async::Test(3pm)NAME
"IO::Async::Test" - utility functions for use in test scripts
SYNOPSIS
use Test::More tests => 1;
use IO::Async::Test;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
testing_loop( $loop );
my $result;
$loop->do_something(
some => args,
on_done => sub {
$result = the_outcome;
}
);
wait_for { defined $result };
is( $result, what_we_expected, 'The event happened' );
...
my $buffer = "";
my $handle = IO::Handle-> ...
wait_for_stream { length $buffer >= 10 } $handle => $buffer;
is( substr( $buffer, 0, 10, "" ), "0123456789", 'Buffer was correct' );
DESCRIPTION
This module provides utility functions that may be useful when writing test scripts for code which uses "IO::Async" (as well as being used
in the "IO::Async" test scripts themselves).
Test scripts are often synchronous by nature; they are a linear sequence of actions to perform, interspersed with assertions which check
for given conditions. This goes against the very nature of "IO::Async" which, being an asynchronisation framework, does not provide a
linear stepped way of working.
In order to write a test, the "wait_for" function provides a way of synchronising the code, so that a given condition is known to hold,
which would typically signify that some event has occured, the outcome of which can now be tested using the usual testing primitives.
Because the primary purpose of "IO::Async" is to provide IO operations on filehandles, a great many tests will likely be based around
connected pipes or socket handles. The "wait_for_stream" function provides a convenient way to wait for some content to be written through
such a connected stream.
FUNCTIONS
testing_loop( $loop )
Set the "IO::Async::Loop" object which the "wait_for" function will loop on.
wait_for( $condfunc )
Repeatedly call the "loop_once" method on the underlying loop (given to the "testing_loop" function), until the given condition function
callback returns true.
To guard against stalled scripts, if the loop indicates a timeout for 10 consequentive seconds, then an error is thrown.
wait_for_stream( $condfunc, $handle, $buffer )
As "wait_for", but will also watch the given IO handle for readability, and whenever it is readable will read bytes in from it into the
given buffer. The buffer is NOT initialised when the function is entered, in case data remains from a previous call.
$buffer can also be a CODE reference, in which case it will be invoked being passed data read from the handle, whenever it is readable.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Test(3pm)