10-15-2012
Thanks, I cannot beleive I have missed it
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
i got a problem with understanding regular expressions. what i wanna do is
scanning the wtmp logfile for ips and if a specific ip is echoed id like to be a part of a text to be assigned to it.
the scanning is done with
#! /bin/bash
cat wtmp | strings | egrep -o "+\.+\.+\." | sort -u... (6 Replies)
Discussion started by: rocketkids
6 Replies
2. Shell Programming and Scripting
I have a simple file test.out that contains data in the form of
key1=A|shift1
key2=B|shift2
key3=C|shift3
and so on.
I need to get it to print
A
B
C
I can do it using lookbehind assertion such as this
( ?<==)()
yet I was wondering if there is another way of mutching single... (8 Replies)
Discussion started by: arushunter
8 Replies
3. Shell Programming and Scripting
Hi
I have a question on regex
There is a line in a script like
my_file="$(echo SunMonTueWed | sed "s//_&g") "
My question what does the expression _&g do.
Obviously in this example the output is
_Sun_Mon_Tue_Wed
Another question can i use some trick to get the result like... (3 Replies)
Discussion started by: xiamin
3 Replies
4. Shell Programming and Scripting
Hi, im sure this is really simple but i cant quite figure it out. how do i test against a word at the beginning of the line but up to the point of a delimiter i.e. ":"
for example if i wanted to test against the user in the /etc/passwd file
peter:x:101:100:peters account:/var/peter:/bin/sh
... (3 Replies)
Discussion started by: hcclnoodles
3 Replies
5. Shell Programming and Scripting
I have a basic question regarding * and . while using regex:
# echo 3 | grep ^*$
3
I think I understood why it outputs "3" here (because '*' matches zero or more of the previous character) but I don't understand the output of the following command:
# echo 3 | grep ^.$
#
I thought I... (7 Replies)
Discussion started by: mirage
7 Replies
6. UNIX for Dummies Questions & Answers
I have dates in mm/dd/yy format that I wish to convert to yy-mm-dd format.
()/()/() finds them, but when I try to replace with $3-$1-$2 both kate and kwrite treat it as a text literal. (2 Replies)
Discussion started by: porphyry5
2 Replies
7. Shell Programming and Scripting
Hi,
I am trying to write a regex for myscript and need some input from experts.
here is what I must grep for
TICKET{Sapce}{Space}{hyphen}
so here is the example data
TICKET 34554, CT-12345, TICKET 12345: some text here
TICKET 2342, CT-12345, MA-12344: some text here
TICKET... (5 Replies)
Discussion started by: rider29
5 Replies
8. Shell Programming and Scripting
Hi guys,
I have a file in the following format:
cmpr5551
cmpr6002
cmpr93
anne 5454
bbro 434
cmprsvc
cmprsvc7
ffgi55
vefe99
cmprsvc8
cmprsvc9
I need to "grep" only the entries which start with "cmpr" followed by the number. All other entries should be excluded.
I was trying to use... (3 Replies)
Discussion started by: aoussenko
3 Replies
9. Shell Programming and Scripting
Hi I am trying to match lines having following string
BIND dn="uid=
putting something like this is not working :
/\sBIND dn="uid=/
Any suggestion.
Thanks. John (9 Replies)
Discussion started by: john_prince
9 Replies
10. Shell Programming and Scripting
I want to match all occurrence of 01,03,05,07,10,11 at 9th and 10th position of a string .
I tried the following but its also matching characters like 33 or 11 on 9th and 10th position .
sed "/^\{8\}00/d" A.TXT
000000001000
433483433339 <<< wrong
121121211100 <<< wrong
167710000110... (10 Replies)
Discussion started by: boncuk
10 Replies
LEARN ABOUT CENTOS
pmunpackeventrecords
PMUNPACKEVENTRECORDS(3) Library Functions Manual PMUNPACKEVENTRECORDS(3)
NAME
pmUnpackEventRecords - unpack event records
C SYNOPSIS
#include <pcp/pmapi.h>
int pmUnpackEventRecords(pmValueSet *vsp, int idx, pmResult ***rap);
cc ... -lpcp
DESCRIPTION
Event records are encoded as a packed array of records within a pmResult using a container metric with a value of type PM_TYPE_EVENT.
pmUnpackEventRecords may be used to unpack event records from a metric value identified by vsp and idx. If the metric has a singular
value, idx should be 0, else the ordinal instance value identified by idx will be unpacked, i.e. vsp->vlist[idx]. The unpacked records are
turned into pmResult structures, one per event record and one metric per event parameter, and rap is returned as a pointer to an array
(NULL pointer terminated) of pointers to the pmResult structures.
Some control information from the packed event records is unpacked into additional ``anonymous'' metrics as follows:
1. If the event record has a non-zero flags value, then the corresponding pmResult will have the flags value encoded with the additional
metric event.flags that is inserted ahead of all other event parameters.
2. If the event record flag is set to PM_EVENT_FLAG_MISSED, then the corresponding pmResult will have one metric event.missed with a value
that equals the number of event records ``missed'' because either the PMDA could not keep up, or the PMAPI client did not collect the
event records fast enough.
pmUnpackEventRecords returns the number of pmResult structures as the return value, which is >= 0 for success.
rset and the associated pmResult structures may be freed using the convenience function pmFreeEventResult(3).
RETURN VALUE
The following errors are possible:
PM_ERR_CONV
The values associated with vsp are not encoded using the format PM_VAL_DPTR or PM_VAL_SPTR, or the flags at the head of the event
record has an unexpected value.
PM_ERR_INST
The value associated with vsp is not singular as expected.
PM_ERR_TYPE
vsp is not a value of type PM_TYPE_EVENT.
PM_ERR_TOOSMALL
The value identified by vbp is not legal because the value length is less than the minimum size, or the number of event records
encoded in the (value header) pmEventArray structure is negative, or the number of missed event records in the pmEventArray array
is negative.
PM_ERR_TOOBIG
Either vsp indicates more than one value is present (all the event records are expected to be packed in a single metric value),
or when unpacking the event records, the processing continues past the end of the enclosing value. Indicates corruption of the
packed event record.
PM_ERR_TYPE
Event parameters must have one of the arithmetic types, else PM_TYPE_AGGREGATE, PM_TYPE_STRING or PM_TYPE_AGGREGATE_STATIC.
other values < 0
refer to pmErrStr(3).
SEE ALSO
PMAPI(3) and pmFreeEventResult(3).
Performance Co-Pilot PCP PMUNPACKEVENTRECORDS(3)