How to read input from a bunch of commands in bash

You can use the <( … ) subshell syntax to read from a bunch of commands, that you whip up on the fly:


cat < <( echo "foo"; sleep 2; echo "bar" )

You can use this for example for accessing IMAP servers, which need a short delay during login.

Leave a Reply

Your email address will not be published.