英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论