Alright, I think I know what I am doing with sed(which probably means I don't). But I cant figure out how to replace just the first occurance of a string. I have tried sed, ed, and grep but can't seem to figure it out. If you have any suggestions I am open to anything! (3 Replies)
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Hi All,
I am working on Solaris sparc 9 and my computer name is mgsun.
I want to bring this machine to a specific domain (e.g.-xx.xx.org).
So please help me to do the same..
thanks in Advance... (4 Replies)
Hi,
Here is my piece of code used with sed in shell script:
sed -i '/<falsemodule-option>/ a\<LdapLogin>' myxmlfile
The problem that i am facing with the above is that in 'myxml' file i have mulitple instances of <falsemodule-option>
so when i execute the above sed command, it is appending... (10 Replies)
Hi All,
I tried to solve this but the result gives me all zeros for one file. I failed to do for all 500 files.
I have some 500 files with the extension .dat I have another set of files; 500 in number with extension .dic I created these .dic files by using sort -u from the actual .dat files.... (2 Replies)
Hello,
I did offline HACMP(PowerHA) upgrade 5.4.1 to 5.5 - basically stopped HACMP services and upgraded cluster.* filesets.
Tried to start services again - topsvcs refused to start on second node complaining that node instance numbers are different - and indeed they are different.
This is... (2 Replies)
Hi, consider a file which has data such as
"random text",912345,"54","finish"
"random text",9991236745,"9954","finish"
I want to replace the numbers that don't have double quotes around them with ones that do; so the output should be
"random text","912345","54","finish"
"random... (4 Replies)
Hi, the title isn't very descriptive but it'll be easier to explain what I need if I write out the coordinates from which I need to extract certain information:
ATOM 2521 C MAM X 61 44.622 49.357 12.584 1.00 0.00 C
ATOM 2522 H MAM X 61 43.644 49.102 12.205 ... (10 Replies)
Hello
I have an file with this content
--------------------------------------------
timer
one
timer
two
timer
three
timer
four
timer
five
timer
six
timer
seven
-------------------------------------------
And I want the following output.... (4 Replies)
Hi All
Been trying to get something working but having some trouble in unix bash or ksh scripting.
Im trying to increment once a condition has been met
Say I have a file that contains:
apple
orange
banana
grapes
dates
kiwi
What im after is once a counter has reached every second... (3 Replies)
Discussion started by: chandika_diran
3 Replies
LEARN ABOUT DEBIAN
rmvq
rmvq(9F) Kernel Functions for Drivers rmvq(9F)NAME
rmvq - remove a message from a queue
SYNOPSIS
#include <sys/stream.h>
void rmvq(queue_t *q, mblk_t *mp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
q Queue containing the message to be removed.
mp Message to remove.
DESCRIPTION
rmvq() removes a message from a queue. A message can be removed from anywhere on a queue. To prevent modules and drivers from having to
deal with the internals of message linkage on a queue, either rmvq() or getq(9F) should be used to remove a message from a queue.
CONTEXT
rmvq() can be called from user or interrupt context.
EXAMPLES
This code fragment illustrates how one may flush one type of message from a queue. In this case, only M_PROTO T_DATA_IND messages are
flushed. For each message on the queue, if it is an M_PROTO message (line 8) of type T_DATA_IND (line 10), save a pointer to the next mes-
sage (line 11), remove the T_DATA_IND message (line 12) and free it (line 13). Continue with the next message in the list (line 19).
1 mblk_t *mp, *nmp;
2 queue_t *q;
3 union T_primitives *tp;
4
5 /* Insert code here to protect queue and message block */
6 mp = q->q_first;
7 while (mp) {
8 if (mp->b_datap->db_type == M_PROTO) {
9 tp = (union T_primitives *)mp->b_rptr;
10 if (tp->type == T_DATA_IND) {
11 nmp = mp->b_next;
12 rmvq(q, mp);
13 freemsg(mp);
14 mp = nmp;
15 } else {
16 mp = mp->b_next;
17 }
18 } else {
19 mp = mp->b_next;
20 }
21 }
22 /* End of region that must be protected */
When using rmvq(), you must ensure that the queue and the message block is not modified by another thread at the same time. You can achieve
this either by using STREAMS functions or by implementing your own locking.
SEE ALSO freemsg(9F), getq(9F), insq(9F)
Writing Device Drivers
STREAMS Programming Guide
WARNINGS
Make sure that the message mp is linked onto q to avoid a possible system panic.
SunOS 5.10 9 Jul 2001 rmvq(9F)