perl -lne 'print ((split /:/)[0])' /etc/passwd
I noticed that you specified that the output should contain the user name as well as the name, but your code only displayed the user name. If you need both:
perl -lne 'print ((split /:/)[0] . " " . (split /:/)[4])' /etc/passwd
In reply to Re: printing passwd file
by eieio
in thread printing passwd file
by madmonster99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |