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.


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

Have a look at this thread: http://lists.gnu.org/archive/html/bug-bash/2008-06/msg00078.html

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

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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