Syntax error : 'end of file' unexpected
Bonjour,
J'ai un batch qui appelle un shell qui fait un certain nombre d'actions sql et batch dans un progiciel mais je rencontre le message d'erreur suivant:
mpts11vz:admactim [] => TT_INTEGRATIONb
./TT_INTEGRATIONb: syntax error at line 80: 'end of file' unexpected
Voici le contenu du fichier shell:
#!/bin/sh RC=0 if ( [ ! -r "$PATH_TOTO/OPX2Modules/local_env" ] ) then echo 'date' " : the file $PATH_TOTO/OPX2Modules/local_env is not present : treatment $0 cancelled" exit 1 fi # loading local_env . $PATH_TOTO/OPX2Modules/local_env # directory of the log files generated by OPX2 OPX_LOG=/INTERFACESTT/logs/batch export OPX_LOG # export date of Toto Intégration in file /tmp/IntegrationDateToto sqlplus -S rtt/totest@mpltototest 1> /tmp/IntegrationDateToto <<. set pause off set pagesize 0 set echo off set term off set feedback off whenever sqlerror exit failure whenever oserror exit failure Select to_char(DATE_VALUE,'DD/MM/YY') from rtt.GLOBALSETTINGS where NAME='_R4TT_AA_D_LAUNCH_INTEGR'; . sqlplus -S rtt/totest@mpltototest 1> /tmp/SystemDateToto <<. set pause off set pagesize 0 set echo off set term off set feedback off whenever sqlerror exit failure whenever oserror exit failure select to_char(sysdate, 'DD/MM/YY') from dual; . # declaration of DateVariable DateInt='cat /tmp/IntegrationDateToto' DateSys='cat /tmp/SystemDateToto' if (test "$DateSys"="$DateInt") then echo '" Toto System Date '$DateSys' is not equals to the next Toto Integration Date '$DateInt'. Integration Batch can't be launch" else echo $DateInt echo $DateSys # execute sql request delete twins and update old work_performed sqlplus rtt/totest@mpltototest @/software/toto/410SP3/OPX2Connect/Admin/TEST_SQL_JBD.sql; # execute sql request delete twins and update old work_performed #sqlplus rtt/totest@mpltototest @/software/toto/410SP3/OPX2Connect/Admin/actime_pre_integration_V5.sql; # batch execution #$OPX2_BASE/bin/start_opx2_batch _R4TT_JS_INTEGR_MOIS_COURANT $OPX_LOG/tt_integration.log > $OPX_LOG/trace-tt_integration.log # execute sql request re-update old work_performed #sqlplus rtt/totest@mpltototest @/software/toto/410SP3/OPX2Connect/Admin/actime_post_integration_V5.sql; # renomme les logs et fichiers utilisés en les préfixant par la date du jour cd $PATH_TOTO/com tt_rename $OPX_LOG/ trace-tt_integration.log tt_rename $OPX_LOG/ toto_pre_integration_V5.log tt_rename $OPX_LOG/ toto_post_integration_V5.log fi RC='expr $RC \| $?' exit $RC
En VI,je n'ai pas de ^M dans mon fichier. Avez-vous une idée sur l'origine de ce message d'erreur?
1 réponse
-
ModérateurSalut,
A première vue, 2 trucs qui me disent pas grand choses ;-\
# declaration of DateVariable
DateInt='cat /tmp/IntegrationDateToto'
DateSys='cat /tmp/SystemDateToto'
C'est des quotes inversées autour de la commande "cat" ?
De nos jours le "$(commande)" est plus approprié...
Ensuite :
if (test "$DateSys"="$DateInt")
then echo '" Toto System Date '$DateSys' is not equals to the next Toto Integration Date '$DateInt'. Integration Batch can't be launch"
Tu commences le "echo" avec une quote simple qui apparemment n'est jamais refermée ;-(
De plus ça doit même interférer avec le "can't be launch" ;-\