#!/usr/bin/bash
. ~/.profile
exec &> /export/home/oracle/scripts/Test_OHS_status.log
/opt/app/oracle/Middleware/Oracle_WT1/instances/instance1/bin/opmnctl status
chmod 777 /export/home/oracle/scripts/Test_OHS_status.log
if [ -f /export/home/oracle/scripts/Test_OHS_status.log ] ; then
cp /export/home/oracle/scripts/Test_OHS_status.log /home/sedward
chmod 777 /home/sedward/Test_OHS_status.log
grep "[Alive, Down]" /home/sedward/Test_OHS_status.log | mailx -s "Test - OHS Status" steven10@gmail.com < /home/sedward/Test_OHS_status.log
fi
else
echo "something wrong with Test OHS" | cat >> /home/sedward/Test_OHS_status.log | mailx -s "check if oracle HTTP server is up on Test" steven10@gmail.com < /home/sedward/Test_OHS_status.log
答案 0 :(得分:0)
如错误消息所述,您有语法错误。
关闭if
块,然后尝试使用else
块:
...
fi
else
...
else
需要成为if
块的一部分:
if ... then
...
else
...
fi