【发布时间】:2017-03-26 03:47:08
【问题描述】:
Andres-Air:~ iivri.andre$ echo 'export GOPATH = $HOME'>> $HOME/.profile
Andres-Air:~ iivri.andre$ source $HOME/.profile
-bash: export: `=': not a valid identifier
-bash: export: `/Users/iivri.andre': not a valid identifier
Andres-Air:~ iivri.andre$ source $HOME/.profile
-bash: export: `=': not a valid identifier
-bash: export: `/Users/iivri.andre': not a valid identifier
我正在尝试将其导出到我的环境中,但出现了这些错误。如何确保正确创建了根目录?
【问题讨论】:
-
=、变量名和值export GOPATH=$HOME >> ~/.profile之间不能有空格 -
@BigDataLearner 这次我没有包含空格,它可以工作,但是当我输入
source $HOME/.profile时,它返回了-bash: export: =' : not a valid identifier.错误 -
在编辑器中打开 .profile 并修复您添加的错误行。
-
@siur - JimB 是对的……你已经插入了带空格的行,你需要删除/编辑那些