
#!/bin/sh
# File	: get_last_users.s
# By	: Maarten.deboer@atos.net, 220303
# Subject	: Script to get the usernames & more of the last users at the (Linux-)system
PGM=`basename $0|cut -d\. -f1` 
VER="0.1"

last | awk '{print $1}'|sort -u|while read USER
do

  if [ "${USER}" != "" ]; then
    USER_COMMENT=`grep ${USER} /etc/passwd|awk -F\: '{print $5}'|head -1`
    echo "|${USER}|${USER_COMMENT}|"
    last | grep ${USER}|head -1

  fi


done




exit 0

