로컬 명령 파일을 원격으로 실행하고 출력을 쉘 창에서 로컬로 가져오고 싶습니다.ssh 연결과 로컬 쉘의 원격 출력
실제로 명령은 원격으로 실행되지만 내 로컬 쉘/콘솔 창에는 결과가 표시되지 않습니다.
다음 명령을 구현하는 방법에 대한 아이디어가 있습니까? fz_multiple_db_connections.sh 포함
ssh [email protected] 'bash -s' < /Users/daniel/bin/bash/fz_multiple_db_connections.sh
:
#!/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