像python-sh一样,可以轻松地用golang调用shell。-Python开发

时间:2021-05-25 16:26:59
【文件属性】:
文件名称:像python-sh一样,可以轻松地用golang调用shell。-Python开发
文件大小:17KB
文件格式:ZIP
更新时间:2021-05-25 16:26:59
Python Command-line Tools go-sh如果您依赖于旧版api,请参见标记:v.0.1安装:go get github.com/codeskyblue/go-sh管道示例:包main import“ github.com/codeskyblue/go-sh” func main( ){sh.Command(“ echo”,“ hello \ tworld”)。Command(“ c go-sh如果您依赖于旧版api,请参见标记:v.0.1安装:go get github.com/codeskyblue/go- sh Pipe示例:包main import“ github.com/codeskyblue/go-sh” func main(){sh.Command(“ echo”,“ hello \ tworld”)。Command(“ cut”,“ -f2”)。因为我喜欢os / exec,所以go-sh是在此基础上建模的,但是go-sh提供了更好的体验。这些是其一些功能:保留变量环境(例如export)的别名支持(例如Shell中的别名)记住当前的dir管道命令
【文件预览】:
go-sh-master
----testdata()
--------executable(0B)
--------linkfile(9B)
--------hello.txt(0B)
----test_test.go(1KB)
----example()
--------timeout()
--------example1.go(888B)
--------less()
--------tail()
----test.go(1KB)
----example_test.go(515B)
----pipe_test.go(3KB)
----LICENSE(11KB)
----wercker.yml(581B)
----go.sum(233B)
----OLD_README.md(2KB)
----README.md(3KB)
----sh.go(4KB)
----sh_test.go(2KB)
----pipe.go(3KB)
----go.mod(119B)

网友评论