Is it possible to pipe normal stdout
further to another program, but store stderr
into a variable?
This is the usecase:
mysqldump database | gzip > database.sql
In this scenario I would like to catch all errors/warnings produced by mysqldump
and store them into a variable, but the normal stdout
(which is the dump) should continue being piped to gzip
.
Any ideas about how to accomplish this?