Unix/Linux Go Back    


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

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

AIX


Tags
aix, unix

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-07-2013
faruqms faruqms is offline
Registered User
 
Join Date: May 2013
Last Activity: 7 May 2013, 9:11 AM EDT
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
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:

Code:
if [ -f ${/backup/RMANBKUP/spool/shelltest.log} ]; then
  egrep (ERROR|error|Error|RMAN-) ${/backup/RMANBKUP/spool/shelltest.log} > /dev/null
  if [ $? = 0 ]; then
    RESULT_MSG=WARNING: Errors occurred during the ${ORACLE_SID} Rman backup full.
    mail -s $RESULT_MSG $DBA < ${BACKUP_LOG_FILE}
    touch /backup/RMANBKUP/spool/error.txt
  else
    egrep (Recovery Manager complete) ${/backup/RMANBKUP/spool/shelltest.log} > /dev/null
    if [ $? = 0 ]; then
      RESULT_MSG=${ORACLE_SID} RMAN Backup Full Completed Successfully.
      mail -s $RESULT_MSG $DBA < ${/backup/RMANBKUP/spool/shelltest.log}
    else
      RESULT_MSG=WARNING: ${ORACLE_SID} RMAN Backup full  did not complete.
      echo Backup process was terminated. | mail -s $RESULT_MSG $DBA
    fi
  fi
fi

i got the error:

Code:
/backup/RMANBKUP/scripts/shelltest.sh[16]: 0403-057 Syntax error at line 17 : `(' is not expected.

Pls help me get rid of this.

Last edited by joeyg; 05-07-2013 at 08:44 AM.. Reason: Tried to do indenting, to make easier to read
Sponsored Links
    #2  
Old Unix and Linux 05-07-2013
Yoda's Unix or Linux Image
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 31 July 2015, 5:38 PM EDT
Location: Galactic Empire
Posts: 3,420
Thanks: 240
Thanked 1,223 Times in 1,149 Posts
Please always indent the code to let people read it better:

Few suggestions and modifications:

Code:
if [ -f "/backup/RMANBKUP/spool/shelltest.log" ]
then
        if egrep -iq "error|RMAN-" "/backup/RMANBKUP/spool/shelltest.log"
        then
                RESULT_MSG="WARNING: Errors occurred during the ${ORACLE_SID} Rman backup full."
                mail -s "$RESULT_MSG" "$DBA" < "$BACKUP_LOG_FILE"
                touch /backup/RMANBKUP/spool/error.txt
        else
                if egrep -q "Recovery Manager complete" "/backup/RMANBKUP/spool/shelltest.log"
                then
                        RESULT_MSG="${ORACLE_SID} RMAN Backup Full Completed Successfully."
                        mail -s "$RESULT_MSG" "$DBA" < "/backup/RMANBKUP/spool/shelltest.log"
                else
                        RESULT_MSG="WARNING: ${ORACLE_SID} RMAN Backup full did not complete."
                        echo "Backup process was terminated." | mail -s "$RESULT_MSG" "$DBA"
                fi
        fi
fi

The Following User Says Thank You to Yoda For This Useful Post:
faruqms (05-07-2013)
Sponsored Links
    #3  
Old Unix and Linux 05-07-2013
joeyg's Unix or Linux Image
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Last Activity: 28 July 2015, 11:10 AM EDT
Location: Within two miles of a Dunkin donuts.
Posts: 2,360
Thanks: 85
Thanked 164 Times in 150 Posts
Is that the entire script?
Error says line 17 but not convinced that the error is on the 17th line of what you pasted into the message
    #4  
Old Unix and Linux 05-07-2013
faruqms faruqms is offline
Registered User
 
Join Date: May 2013
Last Activity: 7 May 2013, 9:11 AM EDT
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
thank you buddy its working.and i will post my scripts clearly sure
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
0403-057 Syntax error at line : `}' is not expected. Puneet sinha Shell Programming and Scripting 1 12-24-2012 10:27 AM
ksh: 0403-057 Syntax error: `done' is not expected. karnatis Shell Programming and Scripting 2 03-28-2012 07:43 PM
Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected. amitsinha Shell Programming and Scripting 3 05-25-2010 02:44 AM
0403-057 Syntax error at line 52 : `)' is not expected. Veenak15 Shell Programming and Scripting 2 08-05-2009 03:47 AM
0403-057 Syntax error at line 70. pls help OMONI UNIX for Dummies Questions & Answers 2 07-20-2005 04:37 AM



All times are GMT -4. The time now is 03:46 AM.