Skip to content

Instantly share code, notes, and snippets.

@kdrwygvh
Last active January 7, 2020 15:46
Show Gist options
  • Save kdrwygvh/9c9c64cae7ee6de6f1218d8fa539cdd3 to your computer and use it in GitHub Desktop.
Save kdrwygvh/9c9c64cae7ee6de6f1218d8fa539cdd3 to your computer and use it in GitHub Desktop.
User Log in Date
#!/bin/sh
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
echo "<result>$(w -h "$currentUser" | head -1 | awk '{print $4}')</result>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment