i have attached a sample of my data file. i would like to only display cpu which is above 0 from the data file. how can go with awk to make it display?
Hi,
i have a function which return a variable .
serach ( paramatere) when i excute this function i get the result in the shell,
i want to print this result in a file by calling just the function.
how can i do it..
the code example is like that:
search ( )
{
..
}
the call... (0 Replies)
i want to print the data between two line numbers in file to another file.
which command should i use
i tried sed command . i am storing the line numbers in two variables say L1,L2. but $L1 and $L2 are not working in sed command.
is there any other command to do this
reply soon (5 Replies)
Below is the data content of file_1 and file_2:
file_1
>sample_1
FKGJGPOPOPOQA
ASDADWEEWERE
ASDAWEWQWRW
ASDASDASDASDD
file_2
>sample_1
DRTOWPFPOPOQA
ASDADWEEASDF
ASDADRTYWRW
ASDASDASDASDD
I got try the following perl script. Unfortunately, it can't give my desired output result... (7 Replies)
Hi all,
i have a task to do with Python and because i'm a beginner on it i would like your help on this.
Create a python script that:
Every hour collect the Temperature (e.g. 29C) and Current Condition (e.g. Clear) from this website wunderground.com/global/stations/54511.html
Create a CSV... (0 Replies)
I am trying to move files which donot have same filename using
find /Users/ParijatMac/desktop/unix/new_dir -type f -mmin +"$HRS" -exec mv -n "{}" /Users/ParijatMac/desktop/unix/old_dir \; -print
but i am getting all filenames including the ones with duplicate names.Please help me to sort... (5 Replies)
i run command that return this result,example :
gigabitethernet2/2/4:NotPresent, gigabitethernet2/1/17:UP, gigabitethernet2/1/10:UP, gigabitethernet2/1/5:UP,
gigabitethernet2/1/9:UP, gigabitethernet2/1/36:DOWN, gigabitethernet2/1/33:DOWN, gigabitethernet2/1/8:UP,... (19 Replies)
Hello Unix gurus,
I have a file with this format (example values):
label1 1 0
label2 1 0
label3 0.4 0.6
label4 0.5 0.5
label5 0.1 0.9
label6 0.9 0.1
in which:
column 1 is a row label
column 2 and 3 are values
I would like to do a simple operation on this table and get the... (8 Replies)
i am executing below code to achive my result, but for second row the value is not coming
it should come URL like other two . url start with http:// and end with .xhtml
cat FILE | grep 'Test failed' | awk -F',' '{print $3,$8,$12}'
INPUT
1517679173303,84,SKILLED LANGUAGE - ENTER... (11 Replies)
Discussion started by: mirwasim
11 Replies
LEARN ABOUT FREEBSD
kvm_getpcpu
KVM_GETPCPU(3) BSD Library Functions Manual KVM_GETPCPU(3)NAME
kvm_dpcpu_setcpu kvm_getmaxcpu, kvm_getpcpu -- access per-CPU data
LIBRARY
Kernel Data Access Library (libkvm, -lkvm)
SYNOPSIS
#include <sys/param.h>
#include <sys/pcpu.h>
#include <sys/sysctl.h>
#include <kvm.h>
int
kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu);
int
kvm_getmaxcpu(kvm_t *kd);
int
kvm_getncpus(kvm_t *kd);
void *
kvm_getpcpu(kvm_t *kd, int cpu);
ssize_t
kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu);
uint64_t
kvm_counter_u64_fetch(kvm_t *kd, u_long base);
DESCRIPTION
The kvm_dpcpu_setcpu(), kvm_getmaxcpu(), and kvm_getpcpu() functions are used to access the per-CPU data of active processors in the kernel
indicated by kd. Per-CPU storage comes in two flavours: data stored directly in a struct pcpu associated with each CPU, and dynamic per-CPU
storage (DPCPU), in which a single kernel symbol refers to different data depending on what CPU it is accessed from.
The kvm_getmaxcpu() function returns the maximum number of CPUs supported by the kernel.
The kvm_getncpus() function returns the current number of CPUs in the kernel.
The kvm_getpcpu() function returns a buffer holding the per-CPU data for a single CPU. This buffer is described by the struct pcpu type.
The caller is responsible for releasing the buffer via a call to free(3) when it is no longer needed. If cpu is not active, then NULL is
returned instead.
The kvm_read_zpcpu() function is used to obtain private per-CPU copy from a UMA_ZONE_PCPU zone(9). It takes base argument as base address of
an allocation and copyies size bytes into buf from the part of allocation that is private to cpu.
The kvm_counter_u64_fetch() function fetches value of a counter(9) pointed by base address.
Symbols for dynamic per-CPU data are accessed via kvm_nlist(3) as with other symbols. libkvm maintains a notion of the "current CPU", set by
kvm_dpcpu_setcpu, which defaults to 0. Once another CPU is selected, kvm_nlist(3) will return pointers to that data on the appropriate CPU.
CACHING
kvm_getmaxcpu() and kvm_getpcpu() cache the nlist values for various kernel variables which are reused in successive calls. You may call
either function with kd set to NULL to clear this cache.
RETURN VALUES
On success, the kvm_getmaxcpu() function returns the maximum number of CPUs supported by the kernel. If an error occurs, it returns -1
instead.
On success, the kvm_getpcpu() function returns a pointer to an allocated buffer or NULL. If an error occurs, it returns -1 instead.
On success, the kvm_dpcpu_setcpu() call returns 0; if an error occurs, it returns -1 instead.
On success, the kvm_read_zpcpu() function returns number of bytes copied. If an error occurs, it returns -1 instead.
If any function encounters an error, then an error message may be retrieved via kvm_geterr(3).
SEE ALSO free(3), kvm(3), counter(9), zone(9)BSD February 12, 2014 BSD