【发布时间】:2017-08-15 17:49:16
【问题描述】:
根据run bash command in new shell and stay in new shell after this command executes,我该如何运行命令:
bash --rcfile <(echo "export PS1='> ' && ls")
在 golang 中?我已经尝试了许多exec.Command() 的组合,但它们没有用。例如:
exec.Command("bash", "--rcfile", `<("echo 'ls'")`)
我也读过这个os, os/exec: using redirection symbol '<' '>' failed,但我想我的情况可能有点复杂。
【问题讨论】:
标签: bash go command-line