Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: fridomPosted on 2002-12-16 at 22:19:29ID: 7593486
Hm, is this homework? Now I did not solve it all but here's how the while look can be used.
#!/bin/bash
echo -n "Give me a month name: "
read input
while [ $input != "exit" ]
do
echo -n "you gave me : "
echo $input
echo -n "another month? (exit for end) "
read input
done
echo "Have a nice day"
Usage:
./while_loop.sh
Give me a month name: January
you gave me : January
another month? (exit for end) February
you gave me : February
another month? (exit for end) exit
Have a nice day
It's up to you to check for a valid month name and writing to a file which is easy while using echo.
Regards
Friedrich