I have a small query. I have a file containing the following lines
abcd<12></12>fdfgdf<12>sdfgfg<12>
sdfsdf<12></12>ytunfg<12>
hggfhf<12>rtysb<12>zdfgdfg<12>
Now I wish to delete ONLY the last occurance of string <12> from every lines of code. That mease my final output will be like this:... (7 Replies)
Hi,
I file that has all the status for one day (24hours). Now what I want to do is to count the occurence of a string in its output hourly like for example count occurance of successful or asynchronous clear destinon for every hour and redirect it to file. Please see sample file below. Please... (2 Replies)
Hi,
I am new to Unix world. Is there any command which can directly return the second occurance of a particular string in a file? Basically, I want to read the contents of the file from the second occurance of a particualr string. Can be implemented using a loop, but am just wondering if there... (5 Replies)
Hi,
I'm trying to match records using awk which contain only one occurance of my string, I know how to match one or more (+) but matching only one is eluding me without developing some convoluted bit of code. I was hoping there would be some simple pattern matching thing similar to '+' but... (9 Replies)
Hey Folks,
I have a file that contains data that I am working with, sometimes this file has a very long string of text that messes with an awk command in a script i am trying to build. I would like to cut this string of text out of a file and then redirect everything except that string to a new... (5 Replies)
hi ,
i have an xml that comes in a single, the entire xml file is read as a single line when i open in edit plus or unix. i need to amend the contents of this xml file.
below is the extract from the file
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"... (5 Replies)
I want to replace every 2nd occurance of a string/character from a line.
ababacbsbddbsbbcbdbssb
i want to replace every s2nd b with @ like below
should be like
aba@acbs@ddbs@bc@dbss@ (3 Replies)
So, I have a text file that looks like this:
0,0: (168,168,176) #A8A8B0 srgb(168,168,176)
1,0: (168,168,176) #A8A8B0 srgb(168,168,176)
2,0: (166,166,174) #A6A6AE srgb(166,166,174)
3,0: (166,166,174) #A6A6AE srgb(166,166,174)
4,0: (168,168,176) #A8A8B0 srgb(168,168,176)
5,0:... (0 Replies)
I have two files
1. input.txt
2. keyword.txt
input.txt has contents like
.src_ref 0 "call.s" 24 first
0x000000 0x5a80 0x0060 BRA.l 0x60
.src_ref 0 "call.s" 30 first
0x000002 0x1bc5 RETI
.src_ref 0 "call.s" 31 first
0x000003 0x6840 ... (2 Replies)
My server xml file has huge data part of which i'm sharing below.
I wish to add the below text held by variable "addthisline" after the closing braces i.e --> once the first </Connector> tag is found.
addthisline="I need to be inserted after the comments"
Thus my searchstring is... (3 Replies)
Discussion started by: mohtashims
3 Replies
LEARN ABOUT DEBIAN
io::async::pid
IO::Async::PID(3pm) User Contributed Perl Documentation IO::Async::PID(3pm)NAME
"IO::Async::PID" - event callback on exit of a child process
SYNOPSIS
use IO::Async::PID;
use POSIX qw( WEXITSTATUS );
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $kid = $loop->fork(
code => sub {
print "Child sleeping..
";
sleep 10;
print "Child exiting
";
return 20;
},
);
print "Child process $kid started
";
my $pid = IO::Async::PID->new(
pid => $kid,
on_exit => sub {
my ( $self, $exitcode ) = @_;
printf "Child process %d exited with status %d
",
$self->pid, WEXITSTATUS($exitcode);
},
);
$loop->add( $pid );
$loop->run;
DESCRIPTION
This subclass of IO::Async::Notifier invokes its callback when a process exits.
For most use cases, a IO::Async::Process object provides more control of setting up the process, connecting filehandles to it, sending data
to and receiving data from it.
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters:
on_exit $exitcode
Invoked when the watched process exits.
PARAMETERS
The following named parameters may be passed to "new" or "configure":
pid => INT
The process ID to watch. Must be given before the object has been added to the containing "IO::Async::Loop" object.
on_exit => CODE
CODE reference for the "on_exit" event.
Once the "on_exit" continuation has been invoked, the "IO::Async::PID" object is removed from the containing "IO::Async::Loop" object.
METHODS
$process_id = $pid->pid
Returns the underlying process ID
$pid->kill( $signal )
Sends a signal to the process
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::PID(3pm)