In a nutshell, I need to work out how to return the last matching pattern from an awk //,// search. I can bring back the first, but am unsure how to obtain the last, and a simple tail won't work as the match could be over multiple lines.
Secondly I would like some way of pattern matching, a... (10 Replies)
Dear Team,
How do we match two patterns on the same line using awk?Are there any logical operators which i could use in awk like awk '\gokul && chennai\' <filename>
Eg:
Input file:
gokul,10/11/1986,coimbatore.
gokul,10/11/1986,bangalore.
gokul,12/04/2008,chennai.... (2 Replies)
Hi,
How can I tell awk to print all lines/columns if column number 5 contains the word Monday?
I have tried
nawk -F, '$5==Monday' OFS=, myfile > outputfile
but that doesn't work (I am a newb!!)
Thanks, (7 Replies)
Find bumblebee and Megatron patterns (input2) in input1.
If it is + read input1 patterns from Left to Right
if it is - read input1 patterns from Right to Left
Y= any letter (A/B/C/D)
input1
c1 100 120 TF01_X1 + AABDDAAABDDBCADBDABC
c2 100 120 TF02_X2 - AABDDAAABDDBCBACDBBC... (2 Replies)
Dear Friends,
I have a flat file. To pick certain details we have written an awk where we are facing difficulty.
Sample of flat file.
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
line 12
line 13
line 14 (Matching pattern "Lkm_i-lnr:"can be... (4 Replies)
Hello all,
I am trying to sort thru a database and print all the customers whose first names are only four characters. I just want to pull the first name only from the database.
the database records appear like this in file:
Mike Harrington:(510) 548-1278:250:100:175; first is name Mike... (4 Replies)
Hi,
I am still a beginner on shell scripting so please bear with me.
What i am trying to do is filter my logfile based on some ID on field 24 which is defined in array. The filter result output will be moved to my log folder with the same name. The problem is when not using loop, this command... (2 Replies)
can somebody provide me with some ksh code that will return true if my the contents in my variable match anyone of these strings ORA|ERROR|SP2
variable="Error:ORA-01017: Invalid username/password; logon denied\nSP2-0640:Not connected"
I tried this and it does not seem to work for me
... (3 Replies)
Hi,
I'm very new to these forums. I was wondering if someone could help an AWK beginner with a pattern matching
an actor to his appearance in movies, which would be stored as records. Let's say we have a database of 4 movies (each movie a record with name, studio + year, and actor fields with... (2 Replies)
I have two files, want to compare file1 data with file2 second column and print line which are not matching. Need help in matching the pattern, file2 second column number can be leading 0 or 00 or 000.
Example:
file1
1
2
3
file2
a,0001
b,02
c,000
d,01
e,2
f,0005
Expected output:... (20 Replies)
Discussion started by: vegasluxor
20 Replies
LEARN ABOUT NETBSD
kcpuset_destroy
KCPUSET(9) BSD Kernel Developer's Manual KCPUSET(9)NAME
kcpuset, kcpuset_create, kcpuset_destroy, kcpuset_copy, kcpuset_use, kcpuset_unuse, kcpuset_copyin, kcpuset_copyout, kcpuset_zero,
kcpuset_fill, kcpuset_set, kcpuset_clear, kcpuset_isset, kcpuset_iszero, kcpuset_match, kcpuset_merge, kcpuset_atomic_set,
kcpuset_atomic_clear -- dynamic kernel CPU sets
SYNOPSIS
#include <sys/kcpuset.h>
void
kcpuset_create(kcpuset_t **retkcp, bool zero);
void
kcpuset_destroy(kcpuset_t *kcp);
void
kcpuset_copy(kcpuset_t *dkcp, kcpuset_t *skcp);
void
kcpuset_use(kcpuset_t *kcp);
void
kcpuset_unuse(kcpuset_t *kcp, kcpuset_t **lst);
int
kcpuset_copyin(const cpuset_t *ucp, kcpuset_t *kcp, size_t len);
int
kcpuset_copyout(kcpuset_t *kcp, cpuset_t *ucp, size_t len);
void
kcpuset_zero(kcpuset_t *kcp);
void
kcpuset_fill(kcpuset_t *kcp);
void
kcpuset_set(kcpuset_t *kcp, cpuid_t cpu);
void
kcpuset_clear(kcpuset_t *kcp, cpuid_t cpu);
int
kcpuset_isset(kcpuset_t * kcp, cpuid_t cpu);
bool
kcpuset_iszero(kcpuset_t *kcp);
bool
kcpuset_match(const kcpuset_t *kcp1, const kcpuset_t *kcp2);
void
kcpuset_merge(kcpuset_t *kcp1, kcpuset_t *kcp2);
void
kcpuset_atomic_set(kcpuset_t *kcp, cpuid_t cpu);
void
kcpuset_atomic_clear(kcpuset_t *kcp, cpuid_t cpu);
DESCRIPTION
The machine-independent kcpuset subsystem provides support for dynamic processor sets. Conceptually kcpuset can be understood to be the ker-
nel equivalent of the user space cpuset(3) interface.
FUNCTIONS
kcpuset_create(retkcp, zero)
The kcpuset_create() function creates a dynamic CPU set and stores the result to retkcp. If the boolean zero is not false, the
allocated set is also initialized to zero.
kcpuset_destroy(kcp)
Destroys the CPU set kcp and schedules any linked CPU sets for deferred destruction.
kcpuset_copy(dkcp, skcp)
Copies the CPU set pointed by skcp to dkcp.
kcpuset_use(kcp)
Marks kcp as being in use by increasing the reference count of the object. Note that initially kcpuset_create() sets the reference
count to 1.
kcpuset_unuse(kcp, lst)
Decreases the internal reference count of kcp, and on the last reference (when the count reaches zero), destroys kcp. If lst is not
NULL, then instead of destroying, kcp will be added to the lst list for a deferred destruction.
kcpuset_copyin(ucp, kcp, len)
Copies the len bytes long user-space CPU set ucp to the kernel CPU set kcp.
kcpuset_copyout(kcp, ucp, len)
Copies the kernel CPU set kcp to the user-space CPU set ucp.
kcpuset_zero(kcp)
Clears the set kcp.
kcpuset_fill(kcp)
Fills the whole set kcp with ones.
kcpuset_set(kcp, cpu)
Adds cpu to the set kcp.
kcpuset_clear(kcp, cpu)
Removes cpu from the set kcp.
kcpuset_isset(kcp, cpu)
Returns 1 if cpu is part of the CPU set kcp.
kcpuset_iszero(kcp)
Returns true if the set kcp is empty.
kcpuset_match(kcp1, kcp2)
Compares the sets kcp1 and kcp2, returning true if these are identical.
kcpuset_merge(kcp1, kcp2)
Merges the set kcp2 to the set kcp1.
kcpuset_atomic_set(kcp, cpu)
The kcpuset_atomic_set() function operates as kcpuset_set(), but the operation is atomic; see atomic_ops(3) for more details.
kcpuset_atomic_clear(kcp, cpu)
Removes cpu from the CPU set kcp atomically.
CODE REFERENCES
The kcpuset subsystem is implemented within sys/kern/subr_kcpuset.c.
SEE ALSO cpuset(3)HISTORY
The kcpuset subsystem first appeared in NetBSD 6.0.
BSD October 6, 2011 BSD