-
Piping to another process (Although this WON’T accomplish what you said you are trying to do):
command1 | command2This will send the output of command1 as the input of command2
-
-execon afind(this will do what you are wanting to do — but is specific tofind)find . -name '*.foo' -exec cat {} \;(Everything between
findand-execare the find predicates you were already using.{}will substitute the particular file you found into the command (cat {}in this case); the\;is to end the-execcommand.) -
send output of one process as command line arguments to another process
command2 `command1`for example:
cat `find . -name '*.foo' -print`(Note these are BACK-QUOTES not regular quotes (under the tilde ~ on my keyboard).)
This will send the output ofcommand1intocommand2as command line arguments. Note that file names containing spaces (newlines, etc) will be broken into separate arguments, though.