ERROR: ./launch_full_backup.sh[18]: Syntax error at line 28 : `else' is not expected.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ERROR: ./launch_full_backup.sh[18]: Syntax error at line 28 : `else' is not expected.
# 1  
Old 08-30-2009
ERROR: ./launch_full_backup.sh[18]: Syntax error at line 28 : `else' is not expected.

Help please! Smilie

I have the following error with the following file and the emails are not arriving to the email, any idea please?

ERROR: ./launch_full_backup.sh[18]: Syntax error at line 28 : `else' is not expected.

FECHA=`date +%d%m%y%H%M`
LOGFILE=/admin/cron/log/full_backup.$FECHA
MAILLIST="emailaddress "$MAILLIST
MAILLIST="emailaddress "$MAILLIST
MAILLIST="emailaddress "$MAILLIST
MAILLIST="emailaddress "$MAILLIST
MAILLIST="emailaddress "$MAILLIST
/admin/cron/full_backup.sh > $LOGFILE 2>> $LOGFILE
RETVAL=$?
if [ $RETVAL -eq 0 ]
mailx -s "Backup result, backup id: $FECHA" $MAILLIST <<EOT
Full Backup $FECHA Successfuly completted.
you can see log detail in $LOGFILE.
EOT
exit 0
else
mailx -s "Errors in backup $FECHA" $MAILLIST <<EOE
PLEASE VERIFY THE BACKUP LOG, POSSIBLE ERROR $FECHA EXCECUTION
PLEASE SEE LOG DETAIL IN $LOGFILE.
RERUN /admin/cron/full_backup.sh COMMAND IF YOU CONSIDER IT NECESSARY.
EOE
exit 1
fi
# 2  
Old 08-30-2009
Straight away I see a missing "then" after the "if"
Code:
if [ $RETVAL -eq 0 ]
then
mailx -s "Backup result, backup id: $FECHA" $MAILLIST <<EOT

# 3  
Old 08-30-2009
Thank you!!!

The problem was fixed! Thanks Scottn!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

0403-057 Syntax error at line 17 : `(' is not expected.

Hi, While executing my code i am getting below Error: ./check_disk1: 0403-057 Syntax error at line 55 : `(' is not expected. My code is : #!/bin/ksh PROGNAME=`basename $0` STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 OS=$(uname) AWK="/usr/bin/awk"... (6 Replies)
Discussion started by: abodage
6 Replies

2. Shell Programming and Scripting

HPUX Syntax error at line 9 : `<' is not expected

Hi All, i'm getting this error, can somebody check? file name is like this 951957039339019_560119_000523_2w47_3060_0038_6002.log filename=$(basename "$1") extension="${filename##*.}" filename="${filename%.*}" IFS="_" read -r -a array... (2 Replies)
Discussion started by: charli1
2 Replies

3. AIX

0403-057 Syntax error at line 17 : `(' is not expected.

Hi, I am new to shell scripting.i am trying to mail after my backup completed. Here is my shell script: if ; then egrep (ERROR|error|Error|RMAN-) ${/backup/RMANBKUP/spool/shelltest.log} > /dev/null if ; then RESULT_MSG=WARNING: Errors occurred during the ${ORACLE_SID} Rman... (3 Replies)
Discussion started by: faruqms
3 Replies

4. Shell Programming and Scripting

0403-057 Syntax error at line : `}' is not expected.

i dont know where m i mistaking.. please help me out with this issue :( thanks in advance:rolleyes: one_main() { a=100 while ; do clear echo "##############################################" echo ":: CURRENTLY YOU ARE IN RC AND OC MARKING ::" echo... (1 Reply)
Discussion started by: Puneet sinha
1 Replies

5. Shell Programming and Scripting

ksh: 0403-057 Syntax error: `done' is not expected.

Hi I am getting error 'ksh: 0403-057 Syntax error: `done' is not expected.' when running below script any one can provide inputs on this. ------------------------ if then echo "Report Name |Modification Date|Report File Size|Owner" >SOX_`date +'%Y%m%d'` while read line do... (2 Replies)
Discussion started by: karnatis
2 Replies

6. UNIX for Dummies Questions & Answers

> 5 ")syntax error: operand expected (error token is " error

im kinda new to shell scripting so i need some help i try to run this script and get the error code > 5 ")syntax error: operand expected (error token is " the code for the script is #!/bin/sh # # script to see if the given value is correct # # Define errors ER_AF=86 # Var is... (4 Replies)
Discussion started by: metal005
4 Replies

7. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

8. Shell Programming and Scripting

syntax error near un expected token =~

Hello. Please help with this code. Returns an error message "syntax error near unexpected token =~. Conditional binary operator expected. if " ]] || " ]] then echo "Enter only valid numbers" fi (2 Replies)
Discussion started by: Pauline mugisha
2 Replies

9. Shell Programming and Scripting

0403-057 Syntax error at line 52 : `)' is not expected.

Can someone please tell me wht is wrong with the following peice of code? I keep getting the following error - 0403-057 Syntax error at line 52 : `)' is not expected. case "${option_count}" in 1) java -Xms256m -Xmx1536m "${APPLNAME}" "${ACTION_TYPE}" > "${LOGFILE}" 2>... (2 Replies)
Discussion started by: Veenak15
2 Replies

10. UNIX for Advanced & Expert Users

I got error like...syntax error on line 1, teletype

Hi All, when i executing scripts i got error like: syntax error on line 1, teletype expr: syntax error expr: syntax error expr: syntax error Please advise to me. Note: Yesterday it's working fine, 2day only i got error. (2 Replies)
Discussion started by: koti_rama
2 Replies
Login or Register to Ask a Question