Welcome to the Linux Foundation Forum!

syntax error near unexpected token `fi'

if [[ -e ${/fms2005/Sample/CronFlag.txt} [[ ; then
echo data file does exist
echo data file does not exist

Error Msg:

Test.bsh: line 6: syntax error near unexpected token `fi'

Test.bsh: line 6: `fi'

what wrong with my script?

Im connecting to our Solaris Server through xShell...

thanks in advance...


  • mfillpotmfillpot Posts: 2,180
    You don't need the double brackets and you don't need the filename in a variant declaration. In addition you need to put the echo output in quotes.

    The corrected command is below.
    if [ -e /fms2005/Sample/CronFlag.txt ] ; then 
        echo "data file does exist"
       echo "data file does not exist"
  • Thank you sir.. SOLVED!
Sign In or Register to comment.