Hi,
I'm trying to find the nearest match between two columns of numbers, e.g.
1,1
10,8
30,50
20,100
and the search could be e.g. 20,20
returning 10,8 - i.e. 20-10 = 10 and 20-8 = 12 totalling 22, and hence being the nearest match.
any ideas?
thanks a lot, (1 Reply)
All
i am struggling to raplace some text in a line between two (closest) patterns ,
line="/home/usr/bin/:/home/usr/devuser,n1.9/bin:/home/usr/root/bin"
i want to replace "devuser,n1.9" with "NEWVAL", basically all teh text from "devuser" until nearest '/' with some new text.
i tried teh... (1 Reply)
Here is the sample of my file address.txt
Address 1
1234 Drive way
New Orleans, LA
Zipcode :- 12345
Address 2
4567 Spring way
Chicago, IL
Zipcode :- 67890
I would like to grep for an Address title (Ex :- Address 2) , then get its zipcode and echo both in a single line. Ex :- ... (3 Replies)
Hello Guys,
I'm very new on here and require some help matching up and printing some columns using awk.
I have two text files. The first file has Longitude data in column 1 (lon.txt) and the second one (node.txt) has again another Longitude data in column 1 (not exact as the first one) + in... (7 Replies)
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hello,
I have two csv file.
The first one (a huge file) with 3 columns
X, Y, Z
The second one with 2 columns
A, B
All the values are numbers.
I need to parse every "Z" field of the first file, find the closest "B" value in the second and extract from it the "A" relative value, to... (5 Replies)
I'm looking to match an error code against a list of possible codes and get the nearest match. The code would be a 6 character hexadecimal string.
I have a file of error codes all of which have a specific first 3 characters, however, after that the last 3 characters may be specific or generic as... (3 Replies)
I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT CENTOS
keyctl_update
KEYCTL_UPDATE(3) Linux Key Management Calls KEYCTL_UPDATE(3)NAME
keyctl_update - Update a key
SYNOPSIS
#include <keyutils.h>
long keyctl_update(key_serial_t key, const void *payload,
size_t plen);
DESCRIPTION
keyctl_update() updates the payload of a key if the key type permits it.
The caller must have write permission on a key to be able update it.
payload and plen specify the data for the new payload. payload may be NULL and plen may be zero if the key type permits that. The key
type may reject the data if it's in the wrong format or in some other way invalid.
RETURN VALUE
On success keyctl_update() returns 0. On error, the value -1 will be returned and errno will have been set to an appropriate error.
ERRORS
ENOKEY The key specified is invalid.
EKEYEXPIRED
The key specified has expired.
EKEYREVOKED
The key specified had been revoked.
EINVAL The payload data was invalid.
ENOMEM Insufficient memory to store the new payload.
EDQUOT The key quota for this user would be exceeded by increasing the size of the key to accommodate the new payload.
EACCES The key exists, but is not writable by the calling process.
EOPNOTSUPP
The key type does not support the update operation on its keys.
LINKING
This is a library function that can be found in libkeyutils. When linking, -lkeyutils should be specified to the linker.
SEE ALSO keyctl(1),
add_key(2),
keyctl(2),
request_key(2),
keyctl(3),
request-key(8)Linux 4 May 2006 KEYCTL_UPDATE(3)