I'm not sure why my script is always executing the last statment else even if the files file1 and file2 are not empty :
if [[ -s $file1 && -s $file2 ]]
then
echo "files are good"
elif [[ -s $file1 ]]
then
echo -e "$TEXT2" | mail -s "$SUBJECT" "$RECEIVER" &>/dev/null
elif [[ -s $file2 ]]
then
echo -e "$TEXT1" | mail -s "$SUBJECT" "$RECEIVER" &>/dev/null
else
echo -e "$TEXT3" | mail -s "$SUBJECT" "$RECEIVER" &>/dev/null
fi
The requirement is to send a notification if one or both files are empty
Aucun commentaire:
Enregistrer un commentaire