Last active
January 4, 2018 10:37
-
-
Save SSARCandy/b22e136d7833e5453d3f8f1dc46ba606 to your computer and use it in GitHub Desktop.
list account expire status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
sudo cat /etc/shadow \ | |
| awk -F : -v d=$(expr `date +%s` / 86400) \ | |
'{ | |
if ($8 >= 0) { | |
if ($8 > d || $8 <= 0) printf "%15s %5d %s\n", $1, $8, ""; | |
else printf "%15s %5d %s\n", $1, $8, "Expired"; | |
} | |
}' \ | |
| sort -k 3,3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment