第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

Go exec.Command() 返回退出狀態(tài) 64

Go exec.Command() 返回退出狀態(tài) 64

Go
Qyouu 2023-03-15 15:37:44
我想明白了執(zhí)行命令()在去。它很簡單,使用“l(fā)s”、“cat”等主要終端命令也沒有問題……但是,當(dāng)我想在 macOS 中使用“l(fā)og”命令的輸出時(shí)。它總是返回一個(gè)錯(cuò)誤。這是它的簡單用法:func main() {    out, err := exec.Command("log", "help").Output()    if err != nil {        log.Printf("error: %v", err)    }    fmt.Println(string(out))}這是錯(cuò)誤:2022/11/19 20:03:37 error: exit status 64我希望在 macOS 中看到輸出log help。但是,我的程序返回錯(cuò)誤exit status 64如果我遺漏了什么,請告訴我。
查看完整描述

1 回答

?
千巷貓影

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超7個(gè)贊

您的代碼沒有任何問題,如果您嘗試在終端中執(zhí)行完全相同的命令,并查看退出狀態(tài),它將是64:


?  ~ log help

usage:

    log <command>


global options:

    -?, --help

    -q, --quiet

    -v, --verbose


commands:

    collect         gather system logs into a log archive

    config          view/change logging system settings

    erase           delete system logging data

    show            view/search system logs

    stream          watch live system logs

    stats           show system logging statistics


further help:

    log help <command>

    log help predicates


?  ~ echo $?

64

如果您想知道它為什么返回64,您可以詢問sysexits它的含義:


?  ~ man sysexits | grep -A 3 '64'

     EX_USAGE (64)         The command was used incorrectly, e.g., with the

                           wrong number of arguments, a bad flag, a bad syntax

                           in a parameter, or whatever.


查看完整回答
反對 回復(fù) 2023-03-15
  • 1 回答
  • 0 關(guān)注
  • 173 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號