You can select a region and type `C-u M-| command RET’, and it replaces the region with the command output in the same buffer due to the interactive prefix argument of shell-command-on-region.
You can select a region and type `C-u M-| command RET’, and it replaces the region with the command output in the same buffer due to the interactive prefix argument of shell-command-on-region.