简体   繁体   English

echo命令不适用于Windows 10中的PowerShell

[英]echo command doesn't work with PowerShell in Windows 10

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 所以我正在尝试在装有Windows 10的新笔记本电脑中安装golang,我试图通过echo $GOPATH来确保工作路径正确,但它不会返回任何内容,而只会返回主路径。如果我键入echo $HOME

I used set GOPATH=/User/folder/path to set the path, is there anything wrong I am doing? 我使用set GOPATH=/User/folder/path来设置路径,我在做什么错? or is there any missing files or something in the new laptop? 还是新笔记本电脑中缺少任何文件或东西?

It looks like GOPATH is an environment variable, not a variable like $HOME . 看起来GOPATH是环境变量,而不是$HOME这样的变量。 In powershell, you can access environment variables like this: 在powershell中,您可以像这样访问环境变量:

$env:GOPATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM