I wonder if there is a way to create a 'virtual file' from a bash output.
Let's say I want to email the output of
mysqldump as an attachment to an external email address.
I can use Mutt to do so.
mutt option I need to use is
-a <name of the file I want to attach>.
I know I could use a temporary file:
mysqldump mysqldumpoptions > /tmp/tempfile && mutt -a /tmp/tempfile email@example.com
But I would rather redirect the
mysqldump output directly to Mutt instead.
-a option only accepts a file and not a stream,
but maybe there is a way to pass it some kind of virtual file descriptor or something along those lines.
mutt -a $(mysqldump mysqldumpoptions) firstname.lastname@example.org
Is it possible? If not, why?
This is maybe a silly example and there surely are easier ways to do this, but I hope it explains my question about creating a virtual file from the output of another command.