douluogu8713 2015-02-11 03:44
浏览 90
已采纳

安装程序如何在Mac OSX上设置PATH变量?

I'm wondering how PATH variable is set by Mac Installers on Mac OSX.

For example:

Look at golang Mac OSX Installer. From the link https://golang.org/doc/install:

Mac OS X package installer

Download the package file, open it, and follow the prompts to install the Go tools. The package installs the Go distribution to /usr/local/go.

The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.

So, the I can see /usr/local/go/bin in $PATH but it's not being set in .profile, .bashrc or launchd.conf.

Can anybody please help me to understand?

  • 写回答

1条回答 默认 最新

  • dongsuoying9059 2015-02-11 04:08
    关注

    There are a couple methods of setting environment variables in Mac OS X (lots of discussion here). In the case the Go package, it is adding a file in /etc/paths.d named go that contains /usr/local/go/bin. Here's an answer to another question explaining that a utility called path_helper is being launched and it's inspecting the /etc/paths.d directory.

    You can verify this yourself by using an application called Pacifist to inspect the contents of the Go package and looking at the files it's installing.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 vika文档如何与obsidian同步
  • ¥15 华为手机相册里面的照片能够替换成自己想要的照片吗?
  • ¥15 陆空双模式无人机飞控设置
  • ¥15 sentaurus lithography
  • ¥100 求抖音ck号 或者提ck教程
  • ¥15 关于#linux#的问题:子进程1等待子进程A、B退出后退出(语言-c语言)
  • ¥20 web页面如何打开Outlook 365的全球离线通讯簿功能
  • ¥15 io.jsonwebtoken.security.Keys
  • ¥15 急,ubuntu安装后no caching mode page found等
  • ¥15 联想交换机NE2580O/NE1064TO安装SONIC