I would like to run a local command file remotely and get the output locally in my shell window.
Actually the command executes remotely but I do not see the results in my local shell/console window.
Any idea on how to implement the following command?
ssh user@host 'bash -s' < /Users/daniel/bin/bash/fz_multiple_db_connections.sh
Where fz_multiple_db_connections.sh contains:
#!/bin/bash
connections=(
'mysql -u dbuser__name --password=passw dbname '
'mysql -u dbuser__name1 --password=passw1 dbname1')
for f in "${connections[@]}"
do
echo `${f}`
echo `mysql show tables`
echo `mysql exit`
done
exit