为了永久导出变量,我们可以在以下文件中编写导出命令:
~/.profile
~/.bash_profile
/etc/profile
Run Code Online (Sandbox Code Playgroud)
在我的情况下, ~/.bash_profile不存在,因此我在其他两个文件中导出变量:
export country=UK
Run Code Online (Sandbox Code Playgroud)
我现在遇到的问题是我定义的变量 ( country) 对于系统来说仍然是未知的。我在想接下来我该怎么做。
command-line ×1