$ cat log.txt
Name Age Sex Lcation nfld alias xsd
CC 25 M XYZ asx KK Y
BB 21 F XAS awe SS N
SD 21 M AQW rty SD A
How can I replace the column with header "Lcation" with the column with header "alias" and delete the "alias" column?
so that the final output will become:
Name Age Sex... (10 Replies)
I am using the command ls -lhB --group-directories-first --no-group --file-type --time-style=+%D $@ | sed 's/AlphaLexman/ALM/g' to replace my username with my initials (to keep the width shorter), but if my username is in the filename such asreport_by_AlphaLexman.txtit becomesreport_by_ALM.txt
... (2 Replies)
Hi,
I have a very large file which is of the general format:
0 3 4 2 ...
3 2 4 0 ...
0 3 4 2 ...
3 0 4 2 ...
. . . . ...
. . . . ...
I would like to apply a simple awk/sed script to work out whether there are any 2's, 3's and 4's in each column.
The results would look as... (3 Replies)
Hey folks. I wrote a little awk script that summarizes /proc/net/dev info and then pipes it to the nix column command to set up column spacing appropriately.
Here's some example output:
Iface RxMBytes RxPackets RxErrs RxDrop TxMBytes TxPackets TxErrs TxDrop
bond0 9 83830... (3 Replies)
Hello,
I've been trying to get a script working that fetches weather-data and converts it into an .ics file. The script works so far put I'm stuck at the point where I need to add specific static data. A thorough search through the forum did not point me into the right direction.
#!/bin/bash... (3 Replies)
Hello,
I need to translate a file with more thousand lines like thiszoneobjectrename "AAA_to_BBB"in a lineszoneobjectrename "AAA_to_BBB","AAA_BBB"
I tried to using awk and sed in this manner but it don't workgrep _to_ Documenti/zoneSWITCH2 |awk '{print "zoneobjectrename " $2 "," $2= sed... (7 Replies)
input
"A","B","C,D","E","F"
"S","T","U,V","W","X"
"AA","BB","CC,DD","EEEE","FFF"
required output:
"A","B","C,D","C,D","F"
"S", T","U,V","U,V","X"
"AA","BB","CC,DD","CC,DD","FFF"
tried using awk but double quotes not preserving for every field. any help to solve this is much... (5 Replies)
Hi All ,
I am having an input file as stated below
Input file
6 ddk/djhdj/djhdj/Q 10 0.5
dhd/jdjd.djd.nd/QB 01 0.5
hdhd/jd/jd/jdj/Q 10 0.5
512 hd/hdh/gdh/Q 01 0.5
jdjd/jd/ud/j/QB 10 0.5
HD/jsj/djd/Q 01 0.5
71 hdh/jjd/dj/jd/Q 10 0.5
... (5 Replies)
Discussion started by: kshitij
5 Replies
LEARN ABOUT NETBSD
percpu_free
PERCPU(9) BSD Kernel Developer's Manual PERCPU(9)NAME
percpu, percpu_alloc, percpu_free, percpu_getref, percpu_putref, percpu_foreach -- per-CPU storage allocator
SYNOPSIS
#include <sys/percpu.h>
typedef void (*percpu_callback_t)(void *, void *, struct cpu_info *);
percpu_t *
percpu_alloc(size_t size);
void
percpu_free(percpu_t *pc, size_t size);
void *
percpu_getref(percpu_t *pc);
void
percpu_putref(percpu_t *pc);
void
percpu_foreach(percpu_t *pc, percpu_callback_t cb, void *arg);
DESCRIPTION
The machine-independent percpu interface provides per-CPU, CPU-local memory reservations to kernel subsystems. percpu_alloc(size) reserves
on each CPU an independent memory region of size bytes that is local to that CPU, returning a handle (percpu_t) to those regions. A thread
may subsequently ask for a pointer, p, to the region held by the percpu_t on the thread's current CPU. Until the thread relinquishes the
pointer, or voluntarily sleeps, the thread may read or write the region at p without causing interprocessor memory synchronization.
FUNCTIONS
percpu_alloc(size)
Call this in thread context to allocate size bytes of local storage on each CPU. The storage is initialized with zeroes. Treat
this as an expensive operation. percpu_alloc() returns NULL on failure, and a handle for the per-CPU storage on success.
percpu_free(pc, size)
Call this in thread context to return to the system the per-CPU storage held by pc. size should match the size passed to
percpu_alloc(). When percpu_free() returns, pc is undefined. Treat this as an expensive operation.
percpu_getref(pc)
Disable preemption and return a pointer to the storage held by pc on the local CPU. Use percpu_getref() in either thread or inter-
rupt context. Follow each percpu_getref() call with a matching call to percpu_putref().
percpu_putref(pc)
Indicate that the thread is finished with the pointer returned by the matching call to percpu_getref(). Re-enables preemption.
percpu_foreach(pc, cb, arg)
On each CPU, for ci the corresponding struct cpu_info * and p the CPU-local storage held by pc, run (*cb)(p, arg, ci). Call this in
thread context. cb should be non-blocking and fast. Do not rely on cb to be run on the CPUs in any particular order.
CODE REFERENCES
The percpu interface is implemented within the file sys/kern/subr_percpu.c.
SEE ALSO atomic_ops(3), kmem(9), pcq(9), pool_cache(9), xcall(9)HISTORY
The percpu interface first appeared in NetBSD 6.0.
AUTHORS
YAMAMOTO Takashi <yamt@NetBSD.org>
BSD January 23, 2010 BSD