How do I read username and lastupdate attribute values from /etc/security/passwd file and write the obtained data to another file. The data in the new file should be in this format as shown:
sed "s/^\([^:]*\):[^:]*:[^:]*:\([^:]*\).$/\1:\2/" /etc/security/passwd
Note: number of [^:] in the middle of the pattern equals to number of columns separated by ':' you want to skip
Hi All,
As i asked you in my previous post, I want to read username and lastupdate only from /etc/security/passwd and write the same data to another file:
The data in /etc/security/passwd will be in this form for example: