fix version.sh on OSX

The behavior of echo -n is inconsistent across platforms. Using printf
instead should be more portable.

This and any future patches are submitted under the MIT license.