Server Fault is a question and answer site for system and network administrators. 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 can't seem to run portsnap anymore, there seems to be an error and /usr/ports/sysutils/portsnap doesn't exist for a reinstallation.

The error I'm getting when running portsnap is:

/usr/sbin/portsnap: line 882: syntax error near unexpected token 'newline' 
/usr/sbin/portsnap: line 882: ' if !'

Can anyone help me out here.

share|improve this question
up vote 1 down vote accepted

Your error seems to indicate that some other shell is running the script and not sh.

Have a look at this thread:

What happens if you do sh /usr/sbin/portsnap fetch?

share|improve this answer
That was the problem! Thanks, it turned out I had replaced sh with a different script. – Sandeep Bansal May 21 '11 at 13:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.