in reply to printing passwd file
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: printing passwd file
by ambrus (Abbot) on Mar 14, 2005 at 17:53 UTC | |
by halley (Prior) on Mar 14, 2005 at 18:09 UTC | |
by ambrus (Abbot) on Mar 14, 2005 at 18:28 UTC |