有什么聪明的方法可以通过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
Run Code Online (Sandbox Code Playgroud)
是的,我知道它不起作用,但有没有办法实现这一目标?