Hi there i have a problem, i have a script as follows:
----------------------
#!/bin/bash
if [ $1 = "OK" ]; then
mailto -s "Success"
mymail@home.com <<EOF
Hi,
The operation has succeeded.
EOF
elif [$1 = "ERROR" ]; then
mailto -s "Error"
mymail@home.com <<EOF
Hi,
The operation has failed.
EOF
fi
---------------------------
If an OK has been received than i get the following mail:
----------------------------
Hi,
The operation has succeeded.
EOF
elif [OK = "ERROR" ]; then
mailto -s "Error"
mymail@home.com <<EOF
Hi,
The operation has failed.
EOF
fi
------------------------------
And i don't get anything when the scripts gets an ERROR argument.
In other words, the mailto command in my script doesn't see the EOF
as the end of input. Why is that? What am i doing wrong?
kind regards,
Robin