Hi There...
I have an application which starts up many different processes under different names and I'm creating a script to tell me which processes are running (approx 30 different processes). To do this, I parse the results of a ps -u $USER.
My question is, will my script be faster if I run... (2 Replies)
we have 30 GB files on our filesystem which we need to copy daily to 25 location on the same machine (but different filesystem).
cp is taking 20 min to do the copy and we have 5 different thread doing the copy.
so in all its taking around 2 hr and we need to reduce it.
Is there any... (9 Replies)
I have an awk script to find the maximum value of the 2nd column of a 2 column datafile, but I need to find the top 5 maximum values of the 2nd column.
Here is the script that works for the maximum value.
awk 'BEGIN { subjectmax=$1 ; max=0} $2 >= max {subjectmax=$1 ; max=$2} END {print... (3 Replies)
Is there an awk script that can easily perform the following operation?
I have a data file that is in the format of
1944-12,5.6
1945-01,9.8
1945-02,6.7
1945-03,9.3
1945-04,5.9
1945-05,0.7
1945-06,0.0
1945-07,0.0
1945-08,0.0
1945-09,0.0
1945-10,0.2
1945-11,10.5
1945-12,22.3... (3 Replies)
Using Awk, how can I achieve the following?
I have set of record numbers, for which, I have to replace the nth field with some values, say spaces.
Eg:
Set of Records : 4,9,10,55,89,etc
I have to change the 8th field of all the above set of records to spaces (10 spaces).
Its a delimited... (1 Reply)
Hi All,
I am new to this forum and this is my first post.
My requirement is like to optimize the time taken to grep the file with 40000 lines.
There are two files FILEA(40000 lines) FILEB(40000 lines).
The requirement is like this, both the file will be in the format below... (11 Replies)
Hi All,
I extracted a file using an awk command like this
awk '{print substr($0,78,5)"," substr($0,59,6) "," substr($0,81,3) "," substr($0,11,7)}' file1 >> OUTPUT
cat OUTPUT
00001,100000,005,0000080
00001,100000,008,0000220
00001,100000,001,0001000
00010,100000,001,0000400
I want... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
LEARN ABOUT NETBSD
strsuftollx
STRSUFTOLL(3) BSD Library Functions Manual STRSUFTOLL(3)NAME
strsuftoll, strsuftollx -- convert a string to a long long, with suffix parsing
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
long long
strsuftoll(const char *desc, const char *val, long long min, long long max);
long long
strsuftollx(const char *desc, const char *val, long long min, long long max, char *errbuf, size_t errbuflen);
DESCRIPTION
The functions strsuftoll() and strsuftollx() convert val into a number of type long long, checking that the result is not smaller than min or
larger than max. Two or more decimal numbers may be separated by an ``x'' to indicate a product.
Each decimal number may have one of the following optional suffixes:
b Block; multiply by 512
k Kibi; multiply by 1024 (1 KiB)
m Mebi; multiply by 1048576 (1 MiB)
g Gibi; multiply by 1073741824 (1 GiB)
t Tebi; multiply by 1099511627776 (1 TiB)
w Word; multiply by the number of bytes in an integer
In the case of an error (range overflow or an invalid number), strsuftollx() places an error message into errbuf (which is errbuflen bytes
long) and returns 0, and strsuftoll() displays that error and terminates the process. The parameter desc is used to construct errbuf.
Neither desc nor val may be NULL.
RETURN VALUES
The functions strsuftoll() and strsuftollx() return either the result of the conversion, unless the value overflows or is not a number; in
the latter case, strsuftoll() displays an error message and terminates the process with exit code EXIT_FAILURE, and strsuftollx() returns
with 0 and errbuf contains a non-empty error message.
ERRORS
[ERANGE] The given string was out of range; the value converted has been clamped.
SEE ALSO errx(3), strtoll(3), orders(7)BUGS
At least few limitations should be mentioned:
o Both functions ignore the current locale.
o Neither strsuftoll() nor strsuftollx() fail gracefully in case of invalid, NULL, pointers.
o Arguably the return type should be intmax_t instead of long long.
o The strsuftollx() function is prone to buffer overflows if used incorrectly. Arguably only strsuftoll() should be exposed to a caller.
BSD December 14, 2010 BSD