Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I tried this, but it didn't work: My names file was like this: Jeremy Adam Sam My template file was: Dear NAME Hope you come

image text in transcribed

I tried this, but it didn't work:

My names file was like this:

Jeremy

Adam

Sam

My template file was:

Dear NAME

Hope you come to my party!

My code was:

#!/bin/sh template=$(cat mail_template.txt) for name in $( do sed s/NAME/$name/ letter echo $letter > "letter-to-"$name done

7. Suppose you want to write the same letter to many people except that you want each letter addressed to the senders personally. This can be created using a shell script. Put the names of the recipients (one per line) in a file called names. Create a textfile called template which has the string NAME wherever you want the person's name to appear (e.g., Dear NAME, ...). Finally, write a script that produces one file per name (call each file using the person's name with suffix .txt), containing the personalized letter obtained from the template file (use sed). 7. Suppose you want to write the same letter to many people except that you want each letter addressed to the senders personally. This can be created using a shell script. Put the names of the recipients (one per line) in a file called names. Create a textfile called template which has the string NAME wherever you want the person's name to appear (e.g., Dear NAME, ...). Finally, write a script that produces one file per name (call each file using the person's name with suffix .txt), containing the personalized letter obtained from the template file (use sed)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

A Complete Guide To Data Science Essentials

Authors: Miguel

1st Edition

9358684992, 978-9358684995

More Books

Students also viewed these Databases questions