aapl
asked on
Unix script to parse password file information
I am trying to create a script that will pull information from the comment field in the password file, What I want to do is:
for every entry in "ls /home" I want to get the first initial and the last name from the First Last name entry in the comment field of the password file. The username would work in most cases but in some cases the username is truncated to 8 char, so for that reason I need to get this information.
jalberso:x:1002:1000:Jasks on Alberson:/home/jalderso:/u sr/bin/bas h
so in a case like the above example, I want the output of jalberson
for every entry in "ls /home" I want to get the first initial and the last name from the First Last name entry in the comment field of the password file. The username would work in most cases but in some cases the username is truncated to 8 char, so for that reason I need to get this information.
jalberso:x:1002:1000:Jasks
so in a case like the above example, I want the output of jalberson
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!!