[code:1]
#!/bin/sh
#Copy this script from book "Linux Shell".
# Standard AT&T Bourne Shell Script.
# The party program -- Invitations to friends from
# the 'guest' file.
#
guestfile=./guests
if [ ! -f "$guestfile" ]
then
echo "'basename $guestfile' non-existent"
exit 1
fi
PLACE="$USER's"
export PLACE
Time='date +%H'
Time='expr $Time + 1'
set cheese crackers shrimp drinks "hot dogs" sandwiches
for person in 'cat $guestfile'
do
if [ $person = root ]
then
continue
else
# Start of here document
mail -v -s "Party" $person <<- FINIS
Hi $person! Please join me at $PLACE for a party!
Meet me at $Time o'clock.
I'll bring the ice cream. Would you please bring $1
and anything else you would like to eat? Let me know
if you can't make it.
Hope to see you soon.
Your pal,
Ivn@'hostname'
FINIS
shift
if [ $# -eq 0 ]
then
set cheese crackers shrimp drinks "hot dogs" sandwiches
fi
fi
done
echo "Bye ..."
[/code:1]
//
##./party.sh: line 49: syntax error: unexpected end of file
[/code]