usersaccess.sh #1

  • //
  • guest/
  • michael_shields/
  • scripts/
  • usersaccess.sh
  • View
  • Commits
  • Open Download .zip Download (398 B)
#!/bin/sh

# Print users in ascending order of last access time.

# Point to awk that understands strftime() and sort that understands -n.

awk=awk
egrep=egrep
p4=p4
sort=sort

# Print the users.

$p4 -Ztag users | $egrep '^\.\.\. User |^\.\.\. Access ' | $awk '{ user = $3; getline; printf "%s %s\n", $3, user }' | $sort -n - | $awk '{ printf "%s %s\n", strftime( "%Y/%m/%d %H:%M:%S", $1 ), $0 }'
# Change User Description Committed
#1 4629 Michael Shields Scripts for listing clients or users by last access or update time.