I know about zsh feature:
ls -1 >foo >bar
But let me say that I want to run both exits through another command. For example, how would you combine these two commands so as not to run mysqldump twice?
mysqldump db1 | bzip2 > db1.sql.bz2 mysqldump db1 | mysql db2
Closest I can come up with the following:
mysqldump db1 >db1.sql | mysql db2 bzip2 db1.sql
But I would prefer not to write the file to disk without compression (it's big!).
source share