Another variant of printing /proc/PID/cmdline
with spaces in Linux is:
cat -v /proc/PID/cmdline | sed 's/\^@/\ /g' && echo
In this way cat
prints NULL characters as ^@
and then you replace them with a space using sed
; echo
prints a newline.