syntax error near unexpected token `then'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have the following script in a file, which as far as I can see complies to
the help in the OS. ('$ help if'). However, when I try to run the script it
does not work?

Instead I get the following errors at runtime.

/root/scripts/proj.install: line 48: syntax error near unexpected token
`then'
/root/scripts/proj.install: line 48: `  if[ "$?" == 1 ]; then '

I don't understand what is wrong with it, from what I can tell the only
thing I can do is make it an exclusive if statement and therefore I couldn't
have an else or elif in the function? I'm confused to why it would not work?
Please could someone enlighten me of where i'm going wrong?

Thanks,
Stuart Stephen

...blah...
cont
...blah...

cont() {
  /root/scripts/continue
  if[ "$?" == 1 ];
    then
    echo "Continuing process.";
  else
    exit 1;
  fi
}



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux