See Appendix A, Exercise Answers for answers.
Write a program that accepts a list of words on
STDIN and looks for a line containing all five vowels (
u). Run this program on
/usr/dict/words and see what shows up. In other words, enter:
 Your system's dictionary may be somewhere other than /usr/dict/words ; check the spell (1) manpage.
Write a program that looks through /etc/passwd  (on
STDIN), printing the login name and real name of each user. (Hint: use
split to break the line up into fields, then
s/// to get rid of the parts of the
comment field that are after the first comma.)
 If using NIS, your system may have little data in /etc/passwd. See if
passwdgives more information.
Write a program that looks through /etc/passwd (on
STDIN) for two users with the same first name, and prints those names. (Hint: after extracting the first name, create a hash with the name for a key and the number of times it was seen as the value. When the last line of
STDIN has been read, look through the associative array for counts of greater than one.)
Repeat the last exercise, but report the login names of all users with the same first name. (Hint: instead of storing a count, store a list of login names separated by spaces. When finished, look through the values for ones that contain a space.)