script

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

script

Roshan
This post was updated on .
Red Hat Linux 6

Hi,

I am writing a script which checks if the line 'IMP-00000: Import terminated successfully' is present in import dump logfile.
If it is not present, it will write and error in a variable in a file.

Please find below the script


cd /oldbackup/DNRTOOL/cidev/exportlog
arch1=$(ls -t | head -1)
res1=`grep "IMP-00000: Import terminated successfully" $arch1`

cd /oldbackup/DNRTOOL/gaiadev/exportlog
arch2=$(ls -t | head -1)
res2=`grep "IMP-00000: Import terminated successfully" $arch2`

cd /oldbackup/DNRTOOL/gcidev/exportlog
arch3=$(ls -t | head -1)
res3=`grep "IMP-00000: Import terminated successfully" $arch3`

if [ $(res= "") ]
        then
        sed -i 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG=ERROR IN CI/g' /comptel/DNR/DNRTOOL/FILES/application.properties

if [ $(res= "") ]
        then
        sed -i 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG=ERROR IN GAIA/g' /comptel/DNR/DNRTOOL/FILES/application.properties

if [ $(res= "") ]
        then
        sed -i 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG=ERROR IN GCI/g' /comptel/DNR/DNRTOOL/FILES/application.properties

fi
fi
fi



When running the script:

[oracle@rh-ftthprod-db1 DNRTOOL]$ ./checkERR.sh
./checkERR.sh: line 13: : command not found


Can you please advise.

Regards,

Roshan
Reply | Threaded
Open this post in threaded view
|

Re: script

ErmanArslansOracleBlog
Administrator
Check line 13. All starts there..
Check for the "syntax" error..
If you don't have any syntax error, then you have a problematic character there..
Maybe you can't see it, but it can be there.
Rewrite your script.
Also, use notepad++ or a similar tool to see the unseen character/characters.