python就可以实现,利用 subprocess 模块执行 执行脚本的命令就行,例如:
status, _ = subprocess.getstatusoutput('sh test.bash')
function是个什么概念,函数吗,函数里还有脚本,有点不明白你的代码究竟是个什么结构