Click to See Complete Forum and Search --> : Bash scrpit question


JoeyJoeJo
05-18-2004, 11:25 AM
I am making my first bash script with some progress. I have gotten the script to run 100% correctly. i have part the script wich uses the program sendEmail to do just that. I was wondering how I could make it so it asks the user of the script what the destination email address is and then send it to that address. I know this involves variables, but I'm new to bash.

If I need to post my script, just let me know.

sploo22
05-18-2004, 11:53 AM
How about this:

echo -n "Enter e-mail address: "
read address

Then the variable $address holds whatever the user typed.

Dark Ninja
05-18-2004, 11:59 AM
Also, just so you have some good reference material, head to the following two links. Very good sites to learn bash scripting from.

Beginner Guide to BASH - http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html

Advanced Guide to BASH - http://www.tldp.org/LDP/abs/html/index.html