![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using loop reading a file,retrieving data from data base. | Sonu4lov | Shell Programming and Scripting | 1 | 01-19-2007 03:38 AM |
| finding null records in data file | dsravan | Shell Programming and Scripting | 3 | 01-09-2007 03:46 PM |
| finding duplicate files by size and finding pattern matching and its count | jerome Sukumar | Shell Programming and Scripting | 2 | 12-01-2006 04:20 AM |
| removinf files containing duplicate data | asinha63 | AIX | 1 | 03-14-2006 03:07 PM |
| finding data in a file | Selma | Shell Programming and Scripting | 11 | 12-24-2004 03:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Finding duplicate data in a file
A pogram named LOGGEDON returns an output of:
Ref_num IP Address Logged on User 12000 10.10.12.12 12-02-2002 11:00 john 12004 10.10.12.13 12-03-2002 14:00 mary 12012 10.10.12.14 12-03-2002 11:30 bob 12024 10.10.12.12 12-03-2002 09:00 john 12088 10.10.12.14 12-01-2002 21:00 bob Another program REMUSER will terminate a session according to the "Ref_num" i.e. REMUSER 12004 would kill mary's session If you notice the same IP Address has has more than one Logged on session. If there is more than one occurance of the same "IP Address" I want to kill the oldest "Logged on" session. i.e. REMUSER 12000 <<< kills john's oldest session REMUSER 12088 <<< kills bob's oldest session 1. The script would call LOGGEDON and direct its ouput to a temp file. 2. Each duplicate IP Address would be found in the temp file 3. REMUSER would be called with the "Ref_num of the oldest duplicate entry. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|