I would like to run a command on a single line that will tell me if the flag is set for a user's password to be changed on next login. This command will interpret the output and return a true/false.
If the PWMC flag is NOT set, I get a date stamp like this:
pdbedit -L -v <USER.NAME> | grep "Password must change:"
> Password must change: Wed, 30 Oct 2013 08:54:01 CDT
If the PWMC flag IS set, the command returns this:
pdbedit -L -v <USER.NAME> | grep "Password must change:"
> Password must change: 0
So how would I compose a command that can be run on a single line that will tell me through a true/false statement that the PWMC flag is set for a given user?
Thanks!