10 More Discussions You Might Find Interesting
1. AIX
Hi.
My example:
I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that
chown -R log_adm /log/*
chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies
2. Shell Programming and Scripting
Hi all,
I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like
. ; : ! ?I found the following command
sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Discussion started by: georgi58
7 Replies
3. Shell Programming and Scripting
Dear community,
I have one LOG directory with some files. What I need to do is list ONLY the files that are not present in other directory.
Using Bash programming!
LOG DIR | SYNC DIR
FILE1 | FILE1
FILE2 | FILE3
FILE3 | OTHER FILENAME
FILE4 ... (9 Replies)
Discussion started by: Lord Spectre
9 Replies
4. Shell Programming and Scripting
how can i do a case insensitive search/replace but keep the same case?
e.g., i want to change a word like
apple-pie to orange-cake
but for the first word if the first letter of the keyword or the letter after the - is capitalised i want to preserve that
e.g., if the before is:
... (5 Replies)
Discussion started by: vanessafan99
5 Replies
5. Solaris
Hi
I'm in a directory named /tmp/mq7
i need to upgrade the mq version from 6 to 7 but im not sure where is the package located ?
which command in solaris will show me the list of all the packages present in the directory /tmp/mq7 ?
my box is running with solaris version 10. (2 Replies)
Discussion started by: newtoaixos
2 Replies
6. Shell Programming and Scripting
Is there a command that can switch a character variable from UPPER case to lower case?
like
foreach AC ( ABC BCD PLL QIO)
set ac `COMMAND($AC)`
...
end
Thanks a lot! (3 Replies)
Discussion started by: rockytodd
3 Replies
7. Shell Programming and Scripting
Hi all,
i have a data array as followes.
ARRAY=DFSG345GGG
ARRAY=234FDFG090
ARRAY=VDFVGBGHH
so on..........
i need all english letters to be change to lower case. So i am expecting to see
ARRAY=dfsg345ggg
ARRAY=234fdfg090
ARRAY=vdfvgbghh
so on........
If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies
8. Shell Programming and Scripting
how to traverse through each directory (1 Reply)
Discussion started by: Reddy482
1 Replies
9. Programming
How can I get the present working directory in unix system using c programming and stored it in a string ?? (0 Replies)
Discussion started by: winsonlee
0 Replies
10. UNIX for Dummies Questions & Answers
How one can list only the name of directories present in the directory by using ls command. (2 Replies)
Discussion started by: amolpatil54321
2 Replies
CPS::Governor::Deferred(3pm) User Contributed Perl Documentation CPS::Governor::Deferred(3pm)
NAME
"CPS::Governor::Deferred" - iterate at some later point
SYNOPSIS
use CPS qw( gkforeach );
use CPS::Governor::Deferred;
my $gov = CPS::Governor::Deferred->new;
gkforeach( $gov, [ 1 .. 10 ],
sub {
my ( $item, $knext ) = @_;
print "A$item ";
goto &$knext;
},
sub {},
);
gkforeach( $gov, [ 1 .. 10 ],
sub {
my ( $item, $knext ) = @_;
print "B$item ";
goto &$knext;
},
sub {},
);
$gov->flush;
DESCRIPTION
This CPS::Governor allows the functions using it to delay their iteration until some later point when the containing program invokes it.
This allows two main advantages:
o CPU-intensive operations may be split apart and mixed with other IO operations
o Multiple control functions may be executed in pseudo-parallel, interleaving iterations of each giving a kind of concurrency
These are achieved by having the governor store a list of code references that need to be invoked, rather than invoking them immediately.
These references can then be invoked later, perhaps by using an idle watcher in an event framework.
Because each code reference hasn't yet been invoked by the time the "again" method is called, the original caller is free to store more
pending references with the governor. This allows multiple control functions to be interleaved, as in the "A" and "B" example above.
CONSTRUCTOR
$gov = CPS::Governor::Deferred->new( %args )
Returns a new instance of a "CPS::Governor::Deferred" object. Requires no parameters but may take any of the following to adjust its
default behaviour:
defer_after => INT
If given some positive number, $n then the first "$n-1" invocations of the "again" method will in fact be executed immediately.
Thereafter they will be enqueued in the normal mechanism. This gives the effect that longrunning loops will be executed in batches
of $n.
If not supplied then every invocation of "again" will use the queueing mechanism.
METHODS
$pending = $gov->is_pending
Returns true if at least one code reference has been stored that hasn't yet been invoked.
$gov->prod
Invokes all of the currently-stored code references, in the order they were stored. If any new references are stored by these, they will
not yet be invoked, but will be available for the next time this method is called.
$gov->flush
Repeatedly calls "prod" until no more code references are pending.
SUBCLASS METHODS
The following methods are used internally to implement the functionality, which may be useful to implementors of subclasses.
$gov->later( $code, @args )
Used to enqueue the $code ref to be invoked later with the given @args, once it is determined this should be deferred (rather than being
invoked immediately in the case of the first few invocations when "defer_after" is set).
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-06-27 CPS::Governor::Deferred(3pm)