I need a sed solution for the work I am doing. I need to extract the name from /etc/passwd file based on the AIX user id (username). So far I have this and it isn't working. Any working solution would be appreciated.sed /^Ravi02/s/\(^.\{21\}\).\([a-zA-Z]\{50\}\)/\1/p /export/home/Ravi02/passwdHere are some example entries from the passwd file: Jose01:!:49030:49082:Freeman, Joseph III:/export/home/p1jxf01:/bin/kshRavi02:!:37242:1580:Dronavalli, Ravi:/export/home/j1rxd02:/bin/kshBeny01:!:49335:49040:Young, Ben:/export/home/p1bmy01:/bin/kshBased on the id I need to extract the name.If the id is Jose01 I should get Freeman, Joseph IIIor if it the id is Ravi02 then I should get Dronavalli, Ravi.
sed solution to extract the gecos from /etc/passwd based on the username
text processing;sed;aix