how do i search for the phrase "expected" on line one and
"received" on line two. (there is a newline in between the two)
I would like to know if/how this can be done in perl and/or
grep and/or sed (3 Replies)
Hi Gurus, I have a working solution for munging my data but just wondered if there was a way I could streamline it into a single command at all ?
my $filesystem = "backup/server56/oracle/"
$filesystem =~ s/\/+$// ; # remove the trailing slash(es) from the path specified... (4 Replies)
Hi Evereyone,
%q = ();
$q{"a"} = 0;
$q{"b"} = 0;
$q{"c"} = 0;
if ($q{"a"} !=0 || $q{"b"} !=0 || $q{"c"} !=0) {
print "non-zero"
}
if any simple way to do that? assume you have not only a, b, c inside %q, but a, b, c, d, e, ... ...
Thanks (2 Replies)
This is related to one of my previous post but now with a slight difference: I need the "Updated:" to be in one line as well as the "Information:" on one line as well. These are in multiple lines right now as seen below. These can have 2 or more lines that needs to be in one line.
System name:... (8 Replies)
Hi I want to replace single quote with two single quotes in a perl string.
If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Hi All
I need a small help for the below format in making a small script in Perl or Shell.
I have a file in which a single line entries are broken into three line entries.
Eg:
I have a
pen and
notebook.
All i want is to capture in a single line in a separate file.
eg: I have a pen and... (4 Replies)
I can't decide if I should use AWK or PERL after pouring over these forums for hours today I decided I'd post something and see if I couldn't get some advice.
I've got a text file full of hundreds of events in this format:
Record Number : 1
Records in Seq : ... (3 Replies)
Below code extracts multiple field values from XML into array and prints all in one line.
perl -nle '@r=/(?: jndiName| authDataAlias| value| minConnections| maxConnections| connectionTimeout| name)="(+)/g and print join ",",$ENV{tIPnSCOPE},$ENV{pr
ovider},$ENV{impClassName},@r' server.xml
... (4 Replies)
Discussion started by: kchinnam
4 Replies
LEARN ABOUT OSX
pullupmsg
pullupmsg(9F) Kernel Functions for Drivers pullupmsg(9F)NAME
pullupmsg - concatenate bytes in a message
SYNOPSIS
#include <sys/stream.h>
int pullupmsg(mblk_t *mp, ssize_t len);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
mp Pointer to the message whose blocks are to be concatenated. mblk_t is an instance of the msgb(9S) structure.
len Number of bytes to concatenate.
DESCRIPTION
pullupmsg() tries to combine multiple data blocks into a single block. pullupmsg() concatenates and aligns the first len data bytes of the
message pointed to by mp. If len equals -1, all data are concatenated. If len bytes of the same message type cannot be found,
pullupmsg() fails and returns 0.
RETURN VALUES
On success, 1 is returned; on failure, 0 is returned.
CONTEXT
pullupmsg() can be called from user or interrupt context.
EXAMPLES
Example 1: Using pullupmsg()
This is a driver write srv(9E) (service) routine for a device that does not support scatter/gather DMA. For all M_DATA messages, the data
will be transferred to the device with DMA. First, try to pull up the message into one message block with the pullupmsg() function (line
12). If successful, the transfer can be accomplished in one DMA job.
Otherwise, it must be done one message block at a time (lines 19-22). After the data has been transferred to the device, free the message
and continue processing messages on the queue.
1 xxxwsrv(q)
2 queue_t *q;
3 {
4 mblk_t *mp;
5 mblk_t *tmp;
6 caddr_t dma_addr;
7 ssize_t dma_len;
8
9 while ((mp = getq(q)) != NULL) {
10 switch (mp->b_datap->db_type) {
11 case M_DATA:
12 if (pullupmsg(mp, -1)) {
13 dma_addr = vtop(mp->b_rptr);
14 dma_len = mp->b_wptr - mp->b_rptr;
15 xxx_do_dma(dma_addr, dma_len);
16 freemsg(mp);
17 break;
18 }
19 for (tmp = mp; tmp; tmp = tmp->b_cont) {
20 dma_addr = vtop(tmp->b_rptr);
21 dma_len = tmp->b_wptr - tmp->b_rptr;
22 xxx_do_dma(dma_addr, dma_len);
23 }
24 freemsg(mp);
25 break;
. . .
26 }
27 }
28 }
SEE ALSO srv(9E), allocb(9F), msgpullup(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
NOTES
pullupmsg() is not included in the DKI and will be removed from the system in a future release. Device driver writers are strongly encour-
aged to use msgpullup(9F) instead of pullupmsg().
SunOS 5.10 11 Nov 1996 pullupmsg(9F)