gpt4 book ai didi

macos - 如何在Mac终端中运行〜/.bash_profile

转载 作者:行者123 更新时间:2023-12-03 10:51:00 29 4
gpt4 key购买 nike

因此,我正在安装一些用于编码和个人使用的东西,并且需要在终端中运行它(如果您未阅读标题,则在Mac上运行)。
~/.bash_profile
它只是说允许被拒绝,我正在运行OSX 10.8.4 Mountain Lion。我该如何绕过?

最佳答案

您永远都不想运行它,但是您可能想要获取它。

. ~/.bash_profile
source ~/.bash_profile

两者都应该工作。但这是一个奇怪的请求,因为启动bash时应自动获取该文件,除非您明确地以非交互方式启动它。从手册页:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.

关于macos - 如何在Mac终端中运行〜/.bash_profile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18819124/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com