I am using grep to produce output that will be parsed by another program.
grep
However, that program expects output only to be numeric or zero-bytes.
No
Use tr -d to delete characters in a string:
$ grep -c ' ' /etc/passwd | tr -d '\n' 69$ grep -c ' ' /etc/passwd | tr -d '\n' | xxd 0000000: 3639 69 $