Objective: Output from Linux username, passwordlastchanged, passwordexpires in human readable format.
I pulled user info from /etc/passwd and /etc/shadow for users with shell /bin/bash
join -1 1 -2 1 -t : /etc/passwd /etc/shadow |grep bin/bash|awk -F\: '{print $1";"$9";$14}' where $1 = username $9 = number of days since last password change, calculated from 1/1_1970 $14 = number of days to password expiry date, calculated from 1/1_1970 I can get a similar number as $9 and $14 for the current date
expr $(date +%S) /86400 Question: How do I output the value of $9-$(date +%s)/86400 and $14-$(date +%s)/86400 in my current one liner?