Write a program called picnic that will mail a list of users, one at a time, an invitation to a picnic. The list of users will be in a file called friends. One of the users listed in the friends file will be Popeye.
The invitation will be in another file, called invite.
Use file testing to check that both files exist and are readable.
A loop will be used to iterate through the list of users. When Popeye is reached, he will be skipped over (i.e., he does not get an invitation), and the next user on the list sent an invitation, and so forth.
Keep a list with the names of each person who received an invitation. Do this by building an array. After everyone on the list has been sent mail, print the number of people who received mail and a list of their names.
Bonus:
If you have time, you may want to customize your invite file so that each user receives a letter containing his or her name. For example, the message might start:
Dear John,
I hope you can make it to our picnic....
To do this your invite file may be written:
Dear XXX,
I hope you can make it to our picnic....
With sed or awk, you could then substitute XXX with the user name. (It might be tricky putting the capital letter in the user name, as user names are always lowercase.)