I'm using bash shell on Amazon Linux. I can't figure out why my script is dying with a syntax error. My script ends like so
chmod 775 $TFILE2
output_file=$( create_test_results_file "$TFILE2" )
(cat $TFILE2; uuencode $output_file $output_file) | mailx -s "$subject" "$to_email"
rm $output_file
echo "sent second email"
#Cleanup
rm $TFILE1
rm $TFILE2
echo "removed files"
# If node exited unsuccessfully, verify we alert the process above.
if [ $rc1 != 0 ]; then exit $rc1 fi
if [ $rc2 != 0 ]; then exit $rc2 fi
and when I run it, it prints out the last two echo statements, but then seems to die after that
sent second email
removed files
/home/jboss/.jenkins/jobs/springboard/workspace/automated-tests/nodejs/run_tests.sh: line 86: syntax error: unexpected end of file
Can anyone tell me why its dying with the unexpected end of file error?
exit $rc2.