echo命令在Windows 10的PowerShell中无法使用。

huangapple go评论98阅读模式
英文:

echo command doesn't work with PowerShell in Windows 10

问题

所以我正在尝试在我的新笔记本电脑上安装golang,它安装了Windows 10。我试图通过echo $GOPATH来确保工作路径是正确的,但它没有返回任何内容,只有在我输入echo $HOME时才返回主目录路径。

我使用了set GOPATH=/User/folder/path来设置路径,我做错了什么吗?或者新笔记本电脑上是否缺少文件或其他东西?

英文:

So I'm trying to install golang in my new laptop that has Windows 10 installed in, I was trying to make sure that the working path is correct by echo $GOPATH but it doesn't return anything, and it only return the home path if I typed echo $HOME

I used set GOPATH=/User/folder/path to set the path, is there anything wrong I am doing? or is there any missing files or something in the new laptop?

答案1

得分: 9

看起来GOPATH是一个环境变量,而不是像$HOME那样的变量。在PowerShell中,你可以像这样访问环境变量:

$env:GOPATH
英文:

It looks like GOPATH is an environment variable, not a variable like $HOME. In powershell, you can access environment variables like this:

$env:GOPATH

huangapple
  • 本文由 发表于 2015年10月31日 07:08:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/33446139.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定