Sponsored Content
Full Discussion: Last two logins script
Top Forums Shell Programming and Scripting Last two logins script Post 302378222 by diallo0024 on Monday 7th of December 2009 09:07:04 AM
Old 12-07-2009
Last two logins script

This is the contents of my file:

donald.duck 12/07/2009 12:07:58
donald.duck 12/07/2009 12:17:36
donald.duck 12/07/2009 12:22:29
donald.duck 12/07/2009 12:26:39
donald.duck 12/07/2009 12:28:01
mickey.mouse 12/07/2009 12:48:49
mickey.mouse 12/07/2009 12:49:33
mickey.mouse 12/07/2009 12:50:04



These are log in times/dates. How can I just keep the last two entries for any specific user only? I want the new output file to read:

donald.duck 12/07/2009 12:26:39
donald.duck 12/07/2009 12:28:01
mickey.mouse 12/07/2009 12:49:33
mickey.mouse 12/07/2009 12:50:04
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with logins

Could someone please tell me what I would have to do so I can dial in to Solaris through a modem and login? Thanks in advance. Jomar (2 Replies)
Discussion started by: crispyco
2 Replies

2. AIX

Limit logins to 1

Trying to limit 1 login per account... Setup: We have 2 auth logins, one to the AIX (telnet)then into a distribution mgmt software, the users do not have a shell to log into on the AIX itself, so placing a script such as: active=`who | awk '{printf",%s,\n",$1}' | grep ,$LOGNAME, | wc -l` ... (0 Replies)
Discussion started by: pheusion
0 Replies

3. Shell Programming and Scripting

Another question for tracking failed logins via script

Hello Experts, I have this initial shell script that tracks failed login attempts: #!/bin/bash #Fetch failed user logins to file failed-logins.txt grep -i failed /var/log/secure | awk '{ print $1, $2" ", $3" ", $9" ", $11 }' > failed-logins.txt #Splitting the failed-logins in... (10 Replies)
Discussion started by: linuxgeek
10 Replies

4. Shell Programming and Scripting

Help with shell script which logins to hosts

By a shell script When I am logging into hosts one by one with ssh. I am getting below message. Pseudo-terminal will not be allocated because stdin is not a terminal. stty: : Invalid argument stty: : Invalid argument Can you please suggest what should I do to stop this? ... (10 Replies)
Discussion started by: KuldeepSinghTCS
10 Replies

5. Shell Programming and Scripting

Run a script in two differnt logins

Hi, I need to run a script in two different login's in the same server, but it is running only in one login, i have used the corresponding PATH for each login, but still it says " not authorized to put msg in queue". (2 Replies)
Discussion started by: savithavijay
2 Replies

6. AIX

AIX ftp/sftp script monitor to failed logins

Hi All, Any idea on how to write a script on AIX 5.3 to monitor ftp or sftp login failed. Thanks and more power, Itik (2 Replies)
Discussion started by: itik
2 Replies

7. Solaris

User Logins

Is the below logins are needed in the machine..... nuucp , uucp ,smmsp , svctag , listen , webservd , ip ( We are not using printers), Can you help in these? Regards, kumar (3 Replies)
Discussion started by: rajeshkumarvg
3 Replies

8. Shell Programming and Scripting

Emergency...!!! Shell Scripting.... How to start a same script in 3 different logins?

Hi, I've a shell script. If I trigger the script it takes one day to complete the execution. I've to start the same script in 3 different logins of Unix machine simultaneously. Do you have any idea how can I make it? Please suggest.:( Thank you.. (1 Reply)
Discussion started by: testin
1 Replies

9. Shell Programming and Scripting

Shell Scripting.... How to start a same script in 3 different logins?

Hi, I’ve a shell script. If I trigger the script it takes one day to complete the execution. I’ve to start the same script in 3 different logins of Unix machine simultaneously. Do you have any idea how can I make it? Please suggest. Thank you.. Stop making the font size smaller than... (3 Replies)
Discussion started by: testin
3 Replies

10. Shell Programming and Scripting

Script that outputs user logins sorted by duration

Hello, I want to write a script that takes a username as input and outputs the user's logins sorted by duration. Also I want to exclude the "still logged in" entries. I use the "last" command but Im having problems sorting the entries based on the duration. Can you help me? Thanks a lot =) (4 Replies)
Discussion started by: ddante
4 Replies
expack(1)						      General Commands Manual							 expack(1)

NAME
expack - manipulate Flex files SYNOPSIS
expack -a FLEXFILE FILE... expack -c FLEXFILE FILE... expack -x FLEXFILE [INDEX] expack -i MANIFEST expack -l FLEXFILE DESCRIPTION
expack is a command-line utility that lets you extract and create Flex files. Flex files are archives (which means that they act as con- tainers for other files, somewhat like directories) used by Ultima 7 to store most of its data. Note that the names of the original files are not stored in the Flex -- files are only retrievable by their index. Modes of operation -a Add --NOT IMPLEMENTED YET. FUTURE ENHANCEMENT-- This command adds one or more FILEs to the end of FLEXFILE. -c Create This command takes one or more FILEs and bundles them into FLEXFILE, overwriting it in the process. -x Extract Lets you extract the files contained within FLEXFILE. If INDEX is given only the file at this position will be unpacked, otherwise all files are extracted. The created files will be named index.u7o. -i Input Similar to "Create", this command creates FLEXFILE from a number of input files. However, "Input" takes the names of the input files from MANIFEST instead of the command line. MANIFEST must be a list of file names, one per line. The first name is that of the Flex file that is to be created, the rest are the input files used in building it. -l List This command lists the contents of a FLEXFILE. It gives you the number of files contained within the Flex file, as well as the length of each file. EXAMPLES
expack -a animals.flx bee.wav Adds bee.wav to the Flex file animals.flx. expack -a animals.flx hamster.wav snake.wav donkey.wav Adds hamster.wav, snake.wav, and donkey.wav to the Flex file animals.flx. expack -c animals.flx duck.wav cat.wav cow.wav dog.wav Creates a new Flex file animals.flx containing duck.wav, cat.wav, cow.wav, and dog.wav. expack -x text.flx 17 Extracts the file at position 17fromtext.flxinto17.u7o. expack -x text.flx Extracts all files from text.flx into files named 0.u7o, 1.u7o, 2.u7o, etc. expack -i wavlist With wavlist reading: jmsfx.flx ant.wav bee.wav cat.wav will create a new Flex file jmsfx.flx consisting of ant.wav, bee.wav, andcat.wav. expack -l text.flx Lists the number and lenghts of files contained in text.flx. BUGS
The "Add" command (-a) does not work yet. AUTHOR
This manpage was written by Robert Bihlmeyer based on a text by Marc Winterrowd. It may be freely redistributed and modified under the terms of the GNU General Public License version 2 or higher. Exult 2002-03-23 expack(1)
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy