我想知道如果我必须添加export语句来设置bash_profile文件中的一个变量.我该怎么办?例如,如果我必须添加导出AX =’name’,那么我应该简单地在文件的末尾写,或者我还需要写任何其他东西
解决方法
只需在〜/ .bash_profile文件中的任何地方写出AS =’name’即可:
# Append to the end of the file $echo "export AS='name'" >> ~/.bash_profile # Update shell $source ~/.bash_profile
这个第一个命令将添加您想要的文件(或使用文本编辑器),第二个更新的新的变量的shell.