On many unix systems /bin/sh is a bourne shell compatible on does not support the bash syntax used in mjprof script. either change the interpreter to /bin/bash or change the syntax to bourne shell.
e.g. on my laptop i got this when running mjprof:
/home/avishai/tools/mjprof1.0/mjprof: 2: /home/avishai/tools/mjprof1.0/mjprof: Bad substitution