On 1/8/11, Modulok <modu...@gmail.com> wrote: > List, > > Is there a command that lets me send standard input to two different > places at the same time? (i.e. non-sequentially.) Think of it like a > pipe character, but with a 'Y' branch instead. Basically, I want to > record standard input to a log file, but also send it to another > command for processing. > > For example, let's assume we have a command called 'branch' and it > copies standard input to the standard input of all arguments. We could > use it like this: > > cat foo.txt | branch '/bin/echo > log1.txt' '/bin/echo > log2.txt' > > The first 'cat' would read the file, pass it to our theoretical > 'branch' command, which would then start two subprocesses, passing the > input to both of them. The result result would be two copies of the > file. (Obviously making copies of files is not my primary goal, just > an example.) > > I guess another way of explaining it would be two write the same stdin > to two named pipes and then have two different programs read from each > pipe, getting the same output. > > I can probably write something in Python, but thought I'd ask first. > Thanks! > -Modulok- >
Thanks guys! I'll look into the tee(1) command as suggested. You guys rock :) -Modulok- _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"