go - Golang ssh - how to run multiple commands on the same session? -
i'm trying run multiple commands through ssh seems session.run allows 1 command per session ( unless i'm wrong). i'm wondering how can bypass limitation , reuse session or send sequence of commands. reason need run sudo su
within same session next command ( sh /usr/bin/myscript.sh )
you can utilize little trick: sh -c 'cmd1&&cmd2&&cmd3&&cmd4&&etc..'
this single command, actual commands passed argument shell execute them. how docker handles multiple commands.
ssh go
No comments:
Post a Comment