有没有什么聪明的方法可以通过ssh在远程主机上运行本地Bash函数?
例如:
#!/bin/bash
#Definition of the function
f () { ls -l; }
#I want to use the function locally
f
#Execution of the function on the remote machine.
ssh user@host f
#Reuse of the same function on another machine.
ssh user@host2 f
是的,我知道这不管用,但有没有办法做到这一点?