So I've been working on this ksh script to attach a pdf file to an email
using uuencode. Works absolutely brilliant until I put the the script
inside a 'while true do' at which point it wants to attach the pdf as
a zero byte .bin file. WTH? If I remove the while true and just run it
against files in /export/share/pdf all is well. Anyone?

<code>
#!/bin/ksh
while true
do
for name in $(ls /export/share/pdf/ | awk 'BEGIN {FS = "-"} {print $1}')
do
for sendThis in $(ls /export/share/pdf/ | head -n 1)
do
case $name in
"root")
uuencode /export/share/pdf/$sendThis report.pdf | mailx -s
"Report from User1" someone@somewhere.com;;
"steveo")
uuencode /export/share/pdf/$sendThis report.pdf | mailx -s
"Report from User2" someone@somewhere.com;;
esac
rm /export/share/pdf/$sendThis
done
done
done