Replacing echo with printf (issue with -n)