.TH letter "" "" "/rdb Command" .PC "Print form letters from a mailing list" \fBletter \fIletter.1 ... \fB< \fImaillist\fR .PP .II "print letters" .II "letters, print" The command .B letter prints form letters from a standard letter and a mailing list. It is obsolete, because the command .B report is so much more powerful and easier to use; but it is retained for compatibility and as an example of shell programming. .PP .B letter is a shell script, so you can be easily changed it to handle different lists and letters. To modify it, copy .B letter from .B $RDB/bin/letter to your local directory, then use your text editor to edit it. Then you can modify it with a text editor to handle any special features of your mailing list and letters. .SH Example If you have a file called .B maillist that looks like this: .DM Name Ronald McDonald Company McDonald's Street 123 Mac Attack City Memphis State TENN ZIP 30000 Phone (111) 222-3333 .sp \n(pDu Name Chiquita Banana Company United Brands Street Uno Avenido de la Reforma City San Jose State Costa Rica ZIP 123456789 Phone 1234 .DE .PP Assume, too, that the two parts of your letter are in two files. .B letter.1 contains: .DM We have a new product that we want to sell to everyone at .DE .PP And .B letter.2 contains: .DM Please have everyone send us an order. We will be very grateful. .sp \n(pDu Sincerely, .sp \n(pDu Mr. Marketing Makeapile, Inc. .DE .PP To assemble the letter files and the mailing list into one set of mail-merged letters, type the following command: .DM letter letter.1 letter.2 < maillist .DE .PP This produces: .DM Ronald McDonald McDonald's 123 Mac Attack Memphis, TENN 30000 .sp Dear Ronald McDonald: .sp \n(pDu We have a new product that we want to sell to everyone at McDonald's. Please have everyone send us an order. We will be very grateful. .sp Sincerely, .sp \n(pDu Mr. Marketing Makeapile, Inc. .sp \n(pDu \fI< ... spaces to bottom of letter ... > .DE .DM Chiquita Banana United Brands Uno Avenido de la Reforma San Jose, Costa Rica 123456789 .sp Dear Chiquita Banana: .sp \n(pDu We have a new product that we want to sell to everyone at United Brands. Please have everyone send us an order. We will be very grateful. .sp \n(pDu Sincerely, Mr. Marketing Makeapile, Inc. .sp \n(pDu \fI< ... spaces to bottom of letter ... > .DE .PP The following sample letter program prints out the mailing name and address, and the salutation \fBDear \fIName\fR. It then \fBcat\fRs .BR letter.1 , echos the company name, and finally cats .BR letter.2 . .B letter writes its output to temporary file .BR TMP , then .BR nroff 's the .B TMP file to the standard output. .B nroff reformats the file (left and right justified) for each company name's length. .PP By studying the .B letter shell script and the COHERENT shell's documentation .B (sh or .BR ksh) , you can assemble fancy, complex form letters. .SH "See Also" .B label, report .R .br COHERENT Lexicon: .B cat, ksh, nroff, troff, sh .R .SO letter