Converting Null

Since most Linux shells have a major problem with doing this in a sensible way, the following (on my box called simply ‘0’) takes any input (either from files or via a pipe) and converts the characters.

Depends what you are doing I suppose. I was assuming ‘cmd’ would be something like ‘xargs -0’ as so:find -type f | 0 | xargs -0 echo
Which works exactly the same as:find -type f -print0 | xargs -0 echo
I guess it depends on what the command is and how nicely it can process null characters. ‘0’ was originally designed so that programs that do not understand null terminated arguments can work. A good example would be:ls -1 | 0 | xargs -0 echo
Where poor ‘ls’ cannot understand null terminated file names and thus would fail on any file name containing whitespace.