I have a file called products.kp which contains, for example,
12345678,1^M
87654321,2^M
13579123,3
when I run the command
cat products.kp| sed -f kp.sed
where kp.sed contains
s,^M,,
I get the output
12345678,1
87654321,2
13579123,3 (5 Replies)
$ echo a.bc | sed -e "s/\|/\\|/g"
|a|.|b|c|
$
Is the behavior of the sed statement expected ? Or is this a bug in sed ?
OS details
Linux 2.6.9-55.0.0.0.2.ELsmp #1 SMP Wed May 2 14:59:56 PDT 2007 i686 i686 i386 GNU/Linux (8 Replies)
Hi all,
I want to do a very simple thing with sed. I want to print out the line number of a disk I have defined in /etc/exports, so I do:
It's all good, but here's the problem. When I define md0 in a variable, I get nothing from sed:
Why is that? can anybody please help?
Thanks (2 Replies)
Hi,
I got a Textfile contains hundreds of lines like this:
3 02 8293820 0 22 22
All I need is this:
293820 0 22 22
So i decided to delete until the first '8' comes up. But how I can realize that? (9 Replies)
Hi,
I've a txt file which contains the following kind of listed data
18971 ./aosrp18.r
15340 ./aosrp12.r
22996 ./aosrp08.r
17125 ./aosrp06.r
I'm trying to get rid of the ./ in the file and have tried the following with sed but I'm not getting the correct result... I'm not sure what way... (7 Replies)
I have read many threads, but I still didn't find the right answer. May be i didn't find the right thread, though are so many threads for the same question.
Basically the situation is - find date in a file and replace it with another date. (its not homework, its part of lot of a big processing,... (10 Replies)
Hello All,
I have something like below
LDC100/rel/prod/libinactrl.a
LAA2000/rel/prod/libinactrl.a
I want to remove till first forward slash that is outputshould be as below
rel/prod/libinactrl.a
rel/prod/libinactrl.a
How can I do that ??? (8 Replies)
consider this is my sample file format.
in this i want to remove ^@ with space .
please help me in this problm
7305,1310184890,0,0,12,201370,FCASTBHBR0 ,XX ,2,1,2,0,^@,1,1,0,3,1303862400,0,1577923199,1,10,FCASTOR SEED EX-BHABHAR ... (2 Replies)
Discussion started by: ponmuthu-lnx
2 Replies
LEARN ABOUT SUNOS
rmvb
rmvb(9F) Kernel Functions for Drivers rmvb(9F)NAME
rmvb - remove a message block from a message
SYNOPSIS
#include <sys/stream.h>
mblk_t *rmvb(mblk_t *mp, mblk_t *bp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
mp Message from which a block is to be removed. mblk_t is an instance of the
msgb(9S) structure.
bp Message block to be removed.
DESCRIPTION
rmvb() removes a message block (bp) from a message (mp), and returns a pointer to the altered message. The message block is not freed,
merely removed from the message. It is the module or driver's responsibility to free the message block.
RETURN VALUES
If successful, a pointer to the message (minus the removed block) is returned. The pointer is NULL if bp was the only block of the message
before
rmvb() was called. If the designated message block (bp) does not exist, -1 is returned.
CONTEXT
rmvb() can be called from user or interrupt context.
EXAMPLES
This routine removes all zero-length M_DATA message blocks from the given message. For each message block in the message, save the next
message block (line 10). If the current message block is of type M_DATA and has no data in its buffer (line 11), then remove it from the
message (line 12) and free it (line 13). In either case, continue with the next message block in the message (line 16).
1 void
2 xxclean(mp)
3 mblk_t *mp;
4 {
5 mblk_t *tmp;
6 mblk_t *nmp;
7
8 tmp = mp;
9 while (tmp) {
10 nmp = tmp->b_cont;
11 if ((tmp->b_datap->db_type == M_DATA) &&
(tmp->b_rptr == tmp->b_wptr)) {
12 (void) rmvb(mp, tmp);
13 freeb(tmp);
14 }
15 tmp = nmp;
16 }
17 }
SEE ALSO freeb(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
SunOS 5.10 11 Apr 1991 rmvb(9F)