macos - 从环境变量中删除路径

标签 macos bash

由于错误,我添加了一条我不想使用的路径。
我已经创建了一个名为 .base_profile 的文件,使用命令 source .base_profile 导出了路径,但是我不需要这个路径,如何删除它?

也许标题不太合适,但我没有修改PATH变量。
我在 .base_profile 文件中写了这个:

export MP=$MP/usr/local/mysql/bin

然后使用source命令。问题出在MP变量上,不是我要的,太长了。我想删除它,怎么办?

最佳答案

恢复默认路径的方法是PATH=$(getconf PATH)

关于macos - 从环境变量中删除路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10503153/

相关文章:

ios - Azure 管道 : How to make the Agent use a MacOS variant that has iOS version 16. 1+?

postgresql - 永久设置 PGDATA 环境变量 Mac

c - 在 Mac OS X Lion 上获取 C 中的堆栈指针

performance - Mac OS X 中的每个进程磁盘读/写统计

linux - Linux 中检查文件是否存在的正确方法

ios - 我如何使用 NeoMAD 在 Mac Tiger 上编译我的 iOS 应用程序?

linux - 从干净的登录 shell 运行,无需凭据

bash - 在循环中的 bash shell 脚本中执行 ssh 命令

linux - 如何使用 Nagios 监控生成随机 ID 的日志文件

bash - 通过 bash 脚本将参数传递给/bin/bash