Thanks to everyone. Here are some of the responses I got: Thanks everyone. Paul last | sort -k 1,1 -k 5M,5 -k 6,6 (I used this one, thanks epriebe@acus.com) _________________________________________________________________ The following Perl script should do the job: #!/usr/bin/perl -w /\S/ && push @{$users{(split)[0]}}, $_ while (<>); print @{$users{$_}} for sort { $a cmp $b } keys %users; _________________________________________________________________ IFS=" " for i in `last | head -20` do TIME=`echo $i | awk -F' ' '{print $3,$4,$5,$6," 2002"}' | etime -c -i "%a %b %d %R %Y"` echo $TIME $i done | sort -n _____________________________________________________________________ sort -k 1,1 -k 4,4M -k 5,5n -k 8,8 _____________________________________________________________________ sort -k 3M -k 4n -k 5n _____________________________________________________________________ last > /var/tmp/last.out for i in `awk -F: '{print $1}' /etc/passwd` do grep "^$i" /var/tmp/last.out done _______________________________________________ sunmanagers mailing list sunmanagers@sunmanagers.org http://www.sunmanagers.org/mailman/listinfo/sunmanagersReceived on Wed Feb 20 09:38:21 2002
This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:34 EST