Sponsored Content
Full Discussion: Data mining a text file.
Top Forums Shell Programming and Scripting Data mining a text file. Post 302204867 by akbar on Thursday 12th of June 2008 06:27:39 PM
Old 06-12-2008
Data mining a text file.

I'm auditing UID consistency across our hosts, and have created the following datafile, consisting of four fields. I would like to get a count of the combination of the last two fields. ie: I would like to find out how many instances there are of "root 0" and how many of "uucp 5", for every line in the file. I know basic perl and basic awk, but can't get my head around how to do this.

Can anyone offer advice?

thank you in advance

akbar



UID: crfw root 0
UID: crfw daemon 1
UID: crfw bin 2
UID: crfw sys 3
UID: crfw adm 4
UID: crfw lp 71
UID: crfw uucp 5
UID: crfw nuucp 9
UID: crfw smmsp 25
UID: crfw listen 37
UID: crfw gdm 50
UID: crfw webservd 80
UID: crfw nobody 60001
UID: crfw noaccess 60002
UID: creb root 0
UID: creb daemon 1
UID: creb bin 2
UID: creb sys 3
UID: creb adm 4
UID: creb lp 71
UID: creb uucp 5
UID: creb nuucp 9
UID: creb smmsp 25
UID: creb listen 37
UID: creb gdm 50
UID: creb webservd 80
UID: creb nobody 60001
UID: creb noaccess 60003
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

2. Shell Programming and Scripting

Find and replace data in text file with data in same file

OK I will do my best to explain what I need help with. I am trying to format an ldif file so I can import it into Oracle oid. I need the file to look like this example. Keep in mind there are 3000 of these in the file. changetype: modify replace: userpassword dn:... (0 Replies)
Discussion started by: timothyha22
0 Replies

3. Shell Programming and Scripting

Filter a .kml file (xml) with data set from text file

I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file 11951 11952 74014 11964 11965 11969 11970 11971 11972 60149 74018 74023 86378 11976 11980 11983 11984 11987 (5 Replies)
Discussion started by: pcoj33
5 Replies

4. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies
PERSISTENT-KEYRING(7)					     Linux Programmer's Manual					     PERSISTENT-KEYRING(7)

NAME
persistent-keyring - per-user persistent keyring DESCRIPTION
The persistent keyring is a keyring used to anchor keys on behalf of a user. Each UID the kernel deals with has its own persistent keyring that is shared between all threads owned by that UID. The persistent keyring has a name (description) of the form _persistent.<UID> where <UID> is the user ID of the corresponding user. The persistent keyring may not be accessed directly, even by processes with the appropriate UID. Instead, it must first be linked to one of a process's keyrings, before that keyring can access the persistent keyring by virtue of its possessor permits. This linking is done with the keyctl_get_persistent(3) function. If a persistent keyring does not exist when it is accessed by the keyctl_get_persistent(3) operation, it will be automatically created. Each time the keyctl_get_persistent(3) operation is performed, the persistent key's expiration timer is reset to the value in: /proc/sys/kernel/keys/persistent_keyring_expiry Should the timeout be reached, the persistent keyring will be removed and everything it pins can then be garbage collected. The key will then be re-created on a subsequent call to keyctl_get_persistent(3). The persistent keyring is not directly searched by request_key(2); it is searched only if it is linked into one of the keyrings that is searched by request_key(2). The persistent keyring is independent of clone(2), fork(2), vfork(2), execve(2), and _exit(2). It persists until its expiration timer triggers, at which point it is garbage collected. This allows the persistent keyring to carry keys beyond the life of the kernel's record of the corresponding UID (the destruction of which results in the destruction of the user-keyring(7) and the user-session-keyring(7)). The persistent keyring can thus be used to hold authentication tokens for processes that run without user interaction, such as programs started by cron(8). The persistent keyring is used to store UID-specific objects that themselves have limited lifetimes (e.g., kerberos tokens). If those tokens cease to be used (i.e., the persistent keyring is not accessed), then the timeout of the persistent keyring ensures that the corre- sponding objects are automatically discarded. Special operations The keyutils library provides the keyctl_get_persistent(3) function for manipulating persistent keyrings. (This function is an interface to the keyctl(2) KEYCTL_GET_PERSISTENT operation.) This operation allows the calling thread to get the persistent keyring corresponding to its own UID or, if the thread has the CAP_SETUID capability, the persistent keyring corresponding to some other UID in the same user names- pace. NOTES
Each user namespace owns a keyring called .persistent_register that contains links to all of the persistent keys in that namespace. (The .persistent_register keyring can be seen when reading the contents of the /proc/keys file for the UID 0 in the namespace.) The keyctl_get_persistent(3) operation looks for a key with a name of the form _persistent.<UID> in that keyring, creates the key if it does not exist, and links it into the keyring. SEE ALSO
keyctl(1), keyctl(3), keyctl_get_persistent(3), keyrings(7), process-keyring(7), session-keyring(7), thread-keyring(7), user-keyring(7), user-session-keyring(7) Linux 2017-03-13 PERSISTENT-KEYRING(7)
All times are GMT -4. The time now is 06:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy