2016-11-11 50 views
-4
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 

我正試圖將其導出到我的環境中,但我收到了這些錯誤。我如何確保正確創建根目錄?我在我的Mac上創建我的GOPATH時遇到問題

+2

不應該有'=',變量名和值'出口GOPATH = $ HOME >>之間的空間〜/ .profile' –

+0

@BigDataLearner這一次我不包括它的工作原理,但是當我進入'源$ HOME/.profile'時,它返回了'-bash:export:=':不是一個有效的標識符.'錯誤 – siur

+1

在編輯器中打開.profile並修正錯誤你添加的行。 – JimB

回答

1

它應該是:

echo 'export GOPATH=$HOME' >> $HOME/.profile 
相關問題