hi all,
i have written the following code:
while(proceed !='Y' && proceed!='N' && proceed!='y' && proceed!='n')
{
printf("\nPress \n\t 'Y' or 'y' to continue \n\t 'N' or 'n' to cancel:");
scanf("%c",&proceed);
}
the output i am gettin is:
Press
'Y' to continue
... (1 Reply)
Hi,
I have a directory called logs in which i have the log files.
i have to touch the file before deleting it.
i am doing like this
filestodelete="*.log* *log*"
for files in $filestodelete
do
touch $files $files.$(date +%a)
rm -f $filestodelete
done
touch is not working... (5 Replies)
Hi guys my while do loop is not working properly;
As soon as the load_date and run_date is same it should stop can somebody tell me where I am having the problem?
In an oracle table I have
LOAD_DT=5/1/2009 DATE datatype
RUN_DT=5/5/2009 DATE datatype
Now in a script with a spool file I get the... (15 Replies)
Hi Guys,
This is my code.. I am getting an error in the inside while statement when comparing.. I am not able to figure it out.. Pls help me...
while read value fatherid son_id top_id r_type
do
inside_value=1;
echo $inside_value;
echo $r_type;
while
do
echo... (6 Replies)
Hi
What is wrong with this loop
it was taken has a example in book!!!
it returns
then
/usr/sbin/svcadm disable ppserv
else /usr/sbin/ppadmin stop
fi
} (3 Replies)
hi
I had created a while loop in a script file called whiletest.sh as follows
as follows:
count=0
max=10
while
do
echo $count
echo count=$(count+1)" "
done
echo "value of count:$count"
then i run the script with the command
sh whilestest.sh
but its giving me an error... (5 Replies)
I have a while loop with -f and -o option.Can any one please tell me what that stands for?The Sample code is as follows:-
while
do
## some processing
done (10 Replies)
Hi,
I work on Ab-initio ETL tool which is based on Unix. I made a small script which has two loop's one with in another. All the functionality is working for the first line of outer loop but when it comes to other lines of outer loop it is throwing error as command not found. Below is the... (4 Replies)
I am trying to do a while do loop that asks for a password and returns if the password entered is incorrect. I have that part working however i want to modify it so that if a similar word is entered it will read "that is close but incorrect" and i cannot seem to get it working, being new in the... (6 Replies)
Hi all,
a problem with a loop. Imagine it starts with
var1="$(cat txtif.out )"while
do
echo file1
echo file2
echo y > txtif.out
if
then
break
fi
done
exit 0
the problem is that if the file is changing during the loop seems to continue as it reads "x" state,... (5 Replies)
Discussion started by: Board27
5 Replies
LEARN ABOUT DEBIAN
io::async::routine
IO::Async::Routine(3pm) User Contributed Perl Documentation IO::Async::Routine(3pm)NAME
"IO::Async::Routine" - execute code in an independent sub-process
SYNOPSIS
use IO::Async::Routine;
use IO::Async::Channel;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $nums_ch = IO::Async::Channel->new;
my $ret_ch = IO::Async::Channel->new;
my $routine = IO::Async::Routine->new(
channels_in => [ $nums_ch ],
channels_out => [ $ret_ch ],
code => sub {
my @nums = @{ $nums_ch->recv };
my $ret = 0; $ret += $_ for @nums;
# Can only send references
$ret_ch->send( $ret );
},
on_finish => sub {
say "The routine aborted early - $_[-1]";
$loop->stop;
},
);
$loop->add( $routine );
$nums_ch->send( [ 10, 20, 30 ] );
$ret_ch->recv(
on_recv => sub {
my ( $ch, $totalref ) = @_;
say "The total of 10, 20, 30 is: $$totalref";
$loop->stop;
}
);
$loop->run;
DESCRIPTION
This subclass of IO::Async::Process contains a body of code and executes it in a sub-process, allowing it to act independently of the main
program. Once set up, all communication with the code happens by values passed into or out of the Routine via IO::Async::Channel objects.
Because the code running inside the Routine runs within its own process, it is isolated from the rest of the program, in terms of memory,
CPU time, and other resources, and perhaps most importantly in terms of control flow. The code contained within the Routine is free to make
blocking calls without stalling the rest of the program. This makes it useful for using existing code which has no option not to block
within an "IO::Async"-based program.
To create asynchronous wrappers of functions that return a value based only on their arguments, and do not generally maintain state within
the process it may be more convenient to use an IO::Async::Function instead, which uses an "IO::Async::Routine" to contain the body of the
function and manages the Channels itself.
PARAMETERS
The following named parameters may be passed to "new" or "configure":
channels_in => ARRAY of IO::Async::Channel
ARRAY reference of "IO::Async::Channel" objects to set up for passing values in to the Routine.
channels_out => ARRAY of IO::Async::Channel
ARRAY reference of "IO::Async::Channel" objects to set up for passing values out of the Routine.
code => CODE
CODE reference to the body of the Routine, to execute once the channels are set up.
METHODS
This class provides no additional methods, other than those provided by IO::Async::Process.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Routine(3pm)