I am having some trouble understanding how shell-command-on-region works. Sometimes the region is passed to command, sometimes not, as far as I can tell.
Suppose I have an emacs buffer with "word" in the region, then counting the region's length with wc:
shell-command-on-region wc
returns 0 1 4 , as it should. But other commands don't seem to receive the region as input. For instance, both
shell-command-on-region echo
and
shell-command-on-region locate
produce, respectively, an empty result and an error message ("locate: no pattern to search for specified").
Why is the region passed to the command in the first example and not in the second and third one?