【发布时间】:2014-06-18 14:34:39
【问题描述】:
我想知道是否可以将整个函数作为参数传递给远程服务器以在远程服务器上执行一长串操作并将控制流返回给本地服务器。
在 shell/bash 脚本中。
例如:
如下所示:
test_abc() {
# this function perform a long list of commands to be performed on remote server
command 1;
command 2;
.
..
command N;
few echo commands;
}
ssh user@remote_server test_abc;
我不确定这在 shell 脚本中是否可行。请告诉我。
【问题讨论】: