I also noticed the double quotes and change as follow:
Code:
...
RECEIVER="my.name@mycom.com"
...
if [[ -z $result ]]; then
echo NULL
else
echo RESULT=$result
"$result" | mail -s "$SUBJECT" "$RECEIVER"
fi
...
Now the email is just sent to one email address "my.name@mycom.com". But I can't see the contents though it must be not NULL.
And as I run this script I got:
Code:
RESULT=/var/log/jboss-apps/test/server.log.2013-10-24
./check-file-size: line 17: /var/log/jboss-apps/test/server.log.2013-10-24: Permission denied
Null message body; hope that's ok
The line 17 is: "$result" | mail -s "$SUBJECT" "$RECEIVER"