#!/bin/bash
# Disk Space Monitoring for more than 95 %
# and Sending Alerts by Mail
if [ df -k |awk '$5 > 95 ];
then
`df -k |awk '$5 > 95 {print $1 " ----------- " $5}' |mailx -s "More than 95% disk usage in DEV"
email@test.com';
else
exit 0
fi
I get the below error:
================
bash-3.00$ ./disk_usage_mail_alert-sriram.sh
./disk_usage_mail_alert-sriram.sh: line 14: syntax error near unexpected token `else'
./disk_usage_mail_alert-sriram.sh: line 14: `else '