While the final and most portable solution is a bit convoluted, see <a href="http://stackoverflow.com/questions/12162010/posix-sh-equivalent-for-bash-s-printf-q" rel="nofollow">http://stackoverflow.com/questions/12162010/posix-sh-equival...</a> for other related ideas.