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(3pm) User Contributed Perl Documentation CPS::Governor(3pm)
NAME
"CPS::Governor" - control the iteration of the "CPS" functions
DESCRIPTION
Objects based on this abstract class are used by the "gk*" variants of the CPS functions, to control their behavior. These objects are
expected to provide a method, "again", which the functions will use to re-invoke iterations of loops, and so on. By providing a different
implementation of this method, governor objects can provide such behaviours as rate-limiting, asynchronisation or parallelism, and
integration with event-based IO frameworks.
CONSTRUCTOR
$gov = CPS::Governor->new
Must be called on a subclass which implements the "again" method. Returns a new instance of a governor object in that class.
SUBCLASS METHODS
Because this is an abstract class, instances of it can only be constructed on a subclass which implements the following methods:
$gov->again( $code, @args )
Execute the function given in the "CODE" reference $code, passing in the arguments @args. If this is going to be executed immediately, it
should be invoked using a tail-call directly by the "again" method, so that the stack does not grow arbitrarily. This can be achieved by,
for example:
@_ = @args;
goto &$code;
Alternatively, the Sub::Call::Tail may be used to apply syntactic sugar, allowing you to write instead:
use Sub::Call::Tail;
...
tail $code->( @args );
EXAMPLES
A Governor With A Time Delay
Consider the following subclass, which implements a "CPS::Governor" subclass that calls "sleep()" between every invocation.
package Governor::Sleep
use base qw( CPS::Governor );
sub new
{
my $class = shift;
my ( $delay ) = @_;
my $self = $class->SUPER::new;
$self->{delay} = $delay;
return $self;
}
sub again
{
my $self = shift;
my $code = shift;
sleep $self->{delay};
# @args are still in @_
goto &$code;
}
SEE ALSO
o Sub::Call::Tail - Tail calls for subroutines and methods
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-06-27 CPS::Governor(3pm)