For non-windows need to get the password expiry details for all users

Have a script in shell which fetches password expiry using for loop and chage -l , checked the relevance but unable to find exact inspectors able to get the details

The workaround is to read /etc/shadow file but not able to convert it into tuples to efficiently extract data.

One of these should work. Just dump into a file and use relevance to read…

grep ^\s*PASS_MAX_DAYS /etc/login.defs

grep -E '^[^:]+:[^!*]' /etc/shadow | cut -d: -f1,5

Unfortunately I need it relevance

(items 0 of it ,( if (item 1 of it = 0 ) then "never" else ((item 1 of it + item 2 of it) * day + "01 Jan 1970 00:00:00" as local time  ) as string) ) of (items 0 of it ,(if (it  = "" or  it contains "99999") then 0 else (it as integer)) of (item 1 of it ) , item 2 of it as integer) of((preceding texts of firsts ":" of it , (following texts of lasts ":" of it ) of (preceding texts of lasts ":" of it) of (preceding texts of lasts ":" of it) of (preceding texts of lasts ":" of it) of (preceding texts of lasts ":" of it), /*EPOCH LAST PASS CHANGE DATE */ (preceding texts of firsts ":" of it ) of following texts of firsts ":" of (following texts of firsts ":" of it )) of (lines of file "/etc/shadow"))

Above get results in username, expiry , but not convinced since very brute way to get trying to optimise it hopefully @jgstew helps out