use printf instead of echo -n in substitution test