首页 > 其他 > 详细

执行脚本命令

时间:2019-08-01 23:27:48      阅读:202      评论:0      收藏:0      [点我收藏+]
package main

import (
    "os/exec"
    "fmt"
)

func main()  {
    var(
        cmd *exec.Cmd
        output []byte
        err error
    )

    cmd = exec.Command("D:\\phpStudy\\PHPTutorial\\php\\php-5.6.27-nts\\php.exe","-m")
    if output,err = cmd.CombinedOutput();err !=nil{
        fmt.Println(err)
        return
    }
    fmt.Println(string(output))
}
技术分享图片
GOROOT=D:\go #gosetup
GOPATH=D:\gospace;C:\Users\Administrator\go #gosetup
D:\go\bin\go.exe build -i -o C:\Users\Administrator\AppData\Local\Temp\___go_build_main_go__4_.exe D:/gospace/src/gocode/test/main.go #gosetup
D:\soft\GoLand\bin\runnerw.exe C:\Users\Administrator\AppData\Local\Temp\___go_build_main_go__4_.exe #gosetup
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mongodb
mysql
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend Guard Loader
zip
zlib

[Zend Modules]
Zend Guard Loader



Process finished with exit code 0
View Code

 

执行脚本命令

原文:https://www.cnblogs.com/sunlong88/p/11285673.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!