How to confirm interactive counterparty-client commands in non-Python script

Just a note for others who may wonder about it: because counterparty-client asks for a confirmation (y/n) before it broadcasts a transaction, how to script repeated operations?

The answer is to prepare answers in advance. Example for Bash:

echo "yes" | counterparty-client send ...