在$ PATH中找不到Unix可执行文件

I have a problem when using Go. Here is my code:

package main

import (
    "fmt"
    "os/exec"
)

func main() {
    output, err := exec.Command("pwd").Output()
    fmt.Println(string(output), err)

    output, err = exec.Command("ls", "-l").Output()
    fmt.Println(string(output), err)
}

When I run this, I get the following errors.

err exec: "pwd": executable file not found in $PATH;

err exec: "ls": executable file not found in $PATH

I'm using Ubuntu 14.04.

查看全部
dtbiszu7724
dtbiszu7724
2015/03/17 08:31
  • ubuntu
  • ls
  • pwd
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复