Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a small script to start up gunicorn for a python website I'm making. I have modified the script found at slightly. Here's my version.




if [ -f $PID ]; then rm $PID fi        

cd $ROOT
exec $GUNICORN -b -w 8 -k gevent --pidfile=$PID $APP

When I try to run the script though, it shows this error

/etc/init.d/gunicorn: 13: Syntax error: end of file unexpected (expecting "fi")

Does anyone know what's wrong?

share|improve this question
up vote 7 down vote accepted

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 put this small if statement on a single line. Without them it would look like this:

if [ -f $PID ]
    rm $PID
share|improve this answer
that fixed it! thanks! – tominated Mar 4 '11 at 6:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .