This is what I need to do
I have a file that has a field with values like this
1111 2222
3333 4444
55555 666
333333333
444444444
I need for my command to out put only those fields that do not have spaces in them. So my output for the above file would be
333333333
444444444
how... (10 Replies)
Hello
I want to set two fields in a text file to be of size 20.
how to do it using unix ?
eg: ABC.txt
Name | City
I want Name and City both to be of size 20.
Also If I am pasting it in other file the byte size should be preserved.i.e. If I want to append content of ABC.txt to other... (0 Replies)
Preserve byte size of fields while pasting it to other file
Hello
I want to set two fields in a text file to be of size 20.
how to do it using unix ?
eg: ABC.txt
Name | City
I want Name and City both to be of size 20.
Also If I am pasting it in other file the byte size should be... (1 Reply)
Hi,
Does any one know how to avoid the scenario where awk ignores the fields having only spaces or empty fields?
for instance,
Data: "a","b","c","d",""," "
code:
awk -F, '{ print NF }' File
the output I get is 4 instead of 6 do you know how to avoid this? (6 Replies)
This seems to be a stupid basic question, but I cant get the space to stick in the awk variable.
I do use this command to grep a time range of the log file.
cat /var/log/daemon.log | awk '$0>=from&&$0<=to' from="$(date +%b" "%e" "%H:%M:%S -d -24hour)" to="$(date +%b" "%e" "%H:%M:%S)"
I now... (9 Replies)
Given a file:
# configuration file for newsyslog
# $FreeBSD: /repoman/r/ncvs/src/etc/newsyslog.conf,v 1.50 2005/03/02 00:40:55 brooks Exp $
#
# Entries which do not specify the '/pid_file' field will cause the
# syslogd process to be signalled when that log file is rotated. This
# action... (10 Replies)
Hi All,
I am trying to read a file character by character,
#!/bin/bash
while read -n1 char; do
echo -e "$char\c"
done < /home/shak/testprogram/words
Newyork is a very good city.
Newyorkisaverygoodcityforliving
I need to preserve the spaces as thats an... (3 Replies)
In the below I am trying to use awk to match all the $13 values in input, which is tab-delimited,
that are in $1 of gene which is just a single column of text.
However only the line with the greatest $9 value in input needs to be printed.
So in the example below all the MECP2 and LTBP1... (0 Replies)
In the f1 file below I am trying to clean it up removing lines the have _tn_ in them. Next, removing the characters in $2 before the ninth /. Then I remove the ID_(digit- always 4). Finally, the charcters after and including the first _. It is curently doing most of it but the cut is removing $1... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT NETBSD
pcq_create
PCQ(9) BSD Kernel Developer's Manual PCQ(9)NAME
pcq -- producer/consumer queue
SYNOPSIS
#include <sys/pcq.h>
pcq_t *
pcq_create(size_t maxlen, km_flags_t kmflags);
void
pcq_destroy(pcq_t *pcq);
void *
pcq_get(pcq_t *pcq);
size_t
pcq_maxitems(pcq_t *pcq);
void *
pcq_peek(pcq_t *pcq);
bool
pcq_put(pcq_t *pcq, void *item);
DESCRIPTION
The machine-independent pcq interface provides lockless producer/consumer queues. A queue (pcq_t) allows multiple writers (producers), but
only a single reader (consumer). The consumer is expected to be protected by a lock that covers the structure that the pcq_t is embedded
into (e.g., socket lock, ifnet hwlock). These queues operate in a first-in, first-out (FIFO) manner. The act of inserting or removing an
item from a pcq_t does not modify the item in any way. pcq does not prevent an item from being inserted multiple times into a single pcq_t.
FUNCTIONS
pcq_create(maxlen, kmflags)
Create a queue that can store at most maxlen items at one time. kmflags should be either KM_SLEEP, if pcq_create() is allowed to
sleep until resources are available, or KM_NOSLEEP if it should return NULL immediately, if resources are unavailable.
pcq_destroy(pcq)
Free the resources held by pcq.
pcq_get(pcq)
Remove the next item to be consumed from the queue and return it. If the queue is empty, return NULL. The caller must prevent con-
current gets from occuring.
pcq_maxitems(pcq)
Return the maximum number of items that the queue can store at any one time.
pcq_peek(pcq)
Return the next item to be consumed from the queue but do not remove it from the queue. If the queue is empty, return NULL.
pcq_put(pcq, item)
Place an item at the end of the queue. If there is no room in the queue for the item, return false; otherwise, return true. The
item must not have the value of NULL.
CODE REFERENCES
The pcq interface is implemented within the file sys/kern/subr_pcq.c.
SEE ALSO atomic_ops(3), queue(9)HISTORY
The pcq interface first appeared in NetBSD 6.0.
BSD January 22, 2012 BSD