
다음과 같이 스크립트를 실행하고 싶습니다.
#!/bin/bash
# a ssh connection
ssh USER@HOST << EOF
COMMAND1
COMMAND2
COMMAND3
EOF
# here I should execute some commands locally
COMMAND4
COMMAND5
# here back to *the same* ssh connection
# how?
가능합니까? 그렇다면, 그래서 무엇입니까?
답변1
다음으로 man ssh
세션이 일시 중지되고 localhost로 돌아갑니다 ~
. ^Z
명령을 실행하고 Enter를 눌러 fg
SSH 세션으로 돌아갑니다.