fix version.sh on OSX

The behavior of echo -n is inconsistent across platforms. Using printf
instead should be more portable.