-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Log file info:
2023-09-20 08:34:40 : Sent email regarding Remote appears to have copies of all local files according to diff - Response: Sep 20 08:34:40 {hostname} sendEmail[21714]: Email was sent successfully!
2023-09-20 08:34:40 : Sent email regarding Copied 0 file to remote path {arbitrary path} - Response: Sep 20 08:34:40 {hostname} sendEmail[21723]: Error: "0" is not a recognized option!
Code used to trigger email:
sendEmail () {
sendMailCmd="/usr/local/bin/sendEmail -s {smtprelayhost} -f admin@"$(hostname)".fvm.local -t {from email} -u Message from SVS on "$(hostname)".fvm.local -m "$1
echo "$sendMailCmd"
sendEmail=$sendMailCmd
logger "Sent email regarding $1 - Response: $sendEmail"
}
sendEmail "Copied $locCount file(s) to remote path /mnt/$rp/$filePath/"
sendEmail "Remote appears to have copies of all local files according to diff"
As you can see above I'm using the same function inside of a bash script to send an email based on results of a task using the body as input to the function. The function then reads the body from what was sent. It sends the email without the 0 in the body, but errors on the 0 saying it's not a recognized option. I can't seem to figure out how to resolve this. I've tried single quotes around the body message, I've tried escaping double quotes and neither have worked.
Does anyone have a suggestion?