To create the command that you want, make a file called dummy
with the contents:
#!/bin/sh
cat
Place the file in your PATH and make it executable (chmod a+x dummy
). Because dummy
ignores its arguments, you may place any argument on the command line that you choose. Because the body of dummy
runs cat
(with no arguments), dummy
will echo stdin to stdout.
Alternative
My interest in such dummy command is to be able to identify the processes, then I have multiple cmd1 | cmd2 running.
As an alternative, consider
pgrep cmd1
It will show a process ID for every copy of cmd
that is running. As an example:
$ pgrep getty
3239
4866
4867
4893
This shows that four copies of getty
are running.