Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您可以在任何地方阅读如何替换环境变量。但我想在 $PATH 变量的开头插入一个新路径。使用 sh 执行此操作的最简单方法是什么?
只需为其分配一个包含旧值的新值:
PATH=/new/path:${PATH}