1 Star 1 Fork 1

up-zero/gotool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
exec_linux.go 494 Bytes
一键复制 编辑 原始数据 按行查看 历史
GetcharZp 提交于 2023-08-20 17:56 +08:00 . feat if
//go:build linux
package gotool
import "os/exec"
// ExecShell 运行shell命令或脚本
//
// shell: shell 命令或脚本
func ExecShell(shell string) error {
cmd := exec.Command("/bin/bash", "-c", shell)
return execCmd(cmd, nil)
}
// ExecShellWithNotify 带通知的运行shell命令或脚本
//
// ch: 输出通道
// shell: shell 命令或脚本
func ExecShellWithNotify(ch chan string, shell string) error {
cmd := exec.Command("/bin/bash", "-c", shell)
return execCmd(cmd, ch)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/up-zero/gotool.git
git@gitee.com:up-zero/gotool.git
up-zero
gotool
gotool
main

搜索帮助