|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Anyone know how to code a shell script that will get the userid and last login from wtmpx files of that system and compare it with another wtmpx file FTPed from another system?? Any kinda help is greatly appreaciated!!!
thnx in adv |
|
#2
|
|||
|
|||
|
Quote:
last -f <path to wtmpx file> <user> what exactly do you want to compare between the output of different files? |
|
#3
|
|||
|
|||
|
I just want to compare the user ids between the two files. I want to extract out users in FTPed wtmpx file that are not in the system wtmpx file.....is there any code to do it?
thnx |
|
#4
|
|||
|
|||
|
Can't you just do a for loop of all the unique id's in one and grep for that id in the other?
I'm not familiar with the wtmpx file, but you can do something like the following: cat <file> | tr "<tab>" " " | tr -s " " | cut -d " " -f <field user id is in> to get the ids then a sort -u to get the unique id's using that list for id in <list> do if [ -z "`grep ${id} <other file>`" ] then echo ${id} is not in <other file> fi done |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Getting info from wtmpx files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|