This is simpler:
{ [ `wc -l < report` -eq 4 ] || exit; } 2>/dev/null
echo " Proceed further"
Notes:
If report exists and is 4 lines long, then
wc -l reportreturns:4 report...which
-eqcan't understand. Instead dowc -l < reportwhich outputs an-eq-friendly:4There's no need to check if the filereport exists, since the
<redirection will do that anyway, and returnreturns the same error code.More specific exit codes. If report does not exist, the exit code is 2. If report is 5 lines long, the exit code is 1.