Does running "sh --version" say you're using bash? Or dash?
I think his error come from the fact that Ubuntu uses dash by default. But if you're using dash too, I must be wrong.
sh --version says that -- is an illegal option
But man sh says that I'm using dash