linux - passing a function as parameter to a remote server via ssh command -



linux - passing a function as parameter to a remote server via ssh command -

i wondering if possible pass whole function parameter remote server long list of action on remote server , homecoming command flow local server.

in shell/bash script.

for example:

something below:

test_abc() { # function perform long list of commands performed on remote server command 1; command 2; . .. command n; few echo commands; } ssh user@remote_server test_abc;

i not sure possible in shell scripting. please allow me know.

obviously, remote scheme have no way of understanding in local environment. "test_abc" have command known on "remote_server".

ssh user@remote_server "$(cat <<- _eof_ ((command-list)) _eof_ )"

that, or quote body of "test_abc", may require fiddling quoting correct.

linux bash shell unix ssh

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -