• Home
  • Map
  • Email: mail@helpbest.duckdns.org

Shell syntax error fi unexpected

Thus, bash gets confused when the next thing it sees is fi. Hi All I am getting error in one of my script on Sun Solaris box while running in the script thru command line but from cronjob it is working. Keywords like if, then, else, fi, for, case and so on need to be in a place where the shell expects a command name. Otherwise they are. touch $ HOME/ cron. log fi i am getting error as follows on the last line we are getting. " syntax error near unexpected token ` fi' " please suggest. Yet, when I put if statements exactly like this into a shell script and execute them in an. line 4: syntax error: unexpected " fi" ( expecting " then" ). Syntax error: " ( " unexpected ( expecting " fi" ) # 15. ulysses4ever opened this. Syntax error on Linux Ubuntu with #! / usr/ bin/ env sh # 18. Sounds like the script contains some CR ( \ r) characters.

  • Jandy salt system error code 123
  • Error 3194 iphone 5
  • Parse error syntax error unexpected var t variable in
  • Josh segal trial and error actor


  • Video:Error unexpected shell

    Syntax unexpected error

    If you have edited this script from windows, that would explain why. You need a semi- colon between rm $ PID and fi. Like this: if [ - f $ PID ] ; then rm $ PID; fi. The semi- colons are essentially shorthand so you can. bin/ bash if [ [ - e $ { / fms/ Sample/ CronFlag. txt} [ [ ; then echo data file does exist else echo data file does not exist fi Error Msg: Test. I can only reproduce the specific error you get in dash if I add a \ r after. var= 25 bash - c ' if( ( var= = 5) ) ; then echo Y; else echo " N" ; fi' N $ var= 25.