Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Hello everyone.
I beg your guys pardon please.
I try to ls -al in many path/directories. So, I put the code in text file which look like below;
ls -al /
ls -al /etc
ls -al /etc/default
...
however, when I paste it to Solaris over SecureCRT, it seems the code was escaped from "-" to... (0 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
when i grep for the process "XYZ" , there will be some good number of processes with that name, i want to kill all the these processes at a time using shell script?
Any help needed for this action.
Thanks
Regards,
Anil (6 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT DEBIAN
anyevent::readme
README(3pm) User Contributed Perl Documentation README(3pm)NAME
AnyEvent::Callback - callback aggregator for AnyEvent watchers.
SYNOPSIS
use AnyEvent::Callback;
# usually watchers are looked as:
AE::something @args, sub { ... };
AE::something
@args,
sub { ... }, # result
sub { ... }; # error
use AnyEvent::Callback;
AE::something @args, CB { ... };
AE::something @args,
CB sub { ... }, # result
sub { ... }; # error
AE::something @args,
CB sub { ... }, # result
sub { ... }, # error
sub { ... }; # anyway callback
Callback hierarchy
my $cbchild = $cb->CB(sub { ... });
...
$cbchild->error('error'); # will call $cb->error('error');
Inside Your callback You can:
sub my_watcher {
my $cb = pop;
my @args = @_;
# ...
$cb->error( @error ); # error callback will be called
# or:
$cb->( $value ); # result callback will be called
}
Callbacks stack
my $cbs = CBS;
for (1 .. $n) {
AE::something @args, $cbs->cb;
}
$cbs->wait(sub {
for (@_) {
if ($_->is_error) { # handle one error
my @err = $_->errors; # or:
my $errstr = $_->errstr;
} else { # results
my @res = $_->results;
}
}
});
DESCRIPTION
The module allows You to create callback's hierarchy. Also the module groups error and result callbacks into one object.
Also the module checks if one callback was called by watcher or not. If a watcher doesn't call result or error callback, error callback
will be called automatically.
Also the module checks if a callback was called reentrant. In the case the module will complain (using "carp" in Carp).
If a watcher touches error callback and if superior didn't define error callback, the module will call error callback upwards hierarchy.
Example:
AE::something @args, CB &my_watcher, &on_error;
sub on_error {
}
sub my_watcher {
my $cb = pop;
...
the_other_watcher $cb->CB( sub { # error callback wasn't defined
my $cb = pop;
...
yet_another_watcher1 $cb->CB( sub {
my $cb = pop;
...
$cb->( 123 ); # upwards callback
});
yet_another_watcher2 $cb->CB( sub {
my $cb = pop;
...
$cb->error( 456 ); # on_error will be called
});
});
}
METHODS
'CODE' (overloaded fake method)
$cb->( ... );
You can use the object as usually CODEREF.
CB
Creates new callback object that have binding on parent callback.
my $new_cb = $cb->CB(sub { ... }); # the cb doesn't catch errors
my $new_cb = CB(sub { ... }, sub { ... }); # the cb catches errors
my $new_cb = $cb->CB(sub { ... }, sub { ... }); # the same
error
Calls error callback. If the object has no registered error callbacks, parent object's error callback will be called.
$cb->error('WTF?');
COPYRIGHT AND LICENCE
Copyright (C) 2012 by Dmitry E. Oboukhov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-06-30 README(3pm)