I am trying to run the below script.
val = `wc -l /home/validate.bad | awk '{print $1}' | tail -n1`
valCount = `wc -l /home/validation.txt | awk '{print $1}'`
if [ "$val" -gt 1 ] && ["$valCount" -gt 1]
then
mailx -s "Validation failed" -r [email protected] [email protected]<<-EOF
Hi ,
Validation has failed. Please check.
EOF
elif [ "$valCount" -gt 1 ]
then
mailx -s "Validation pass" -r [email protected] [email protected]<<-EOF
Hi Team,
Validation success.
EOF
fi
But I am getting this error.
Error:
val: comand not found
valCount: command not found
line 3[: : integer expression expected
val=andvalCount=respectively.