简体   繁体   English

为什么终端不解析 .bash_profile 的脚本? (目标是让这个脚本运行并显示当前的工作分支)

[英]Why is terminal not parsing script for .bash_profile ? (goal is for this script to run and show the current working branch)

I hoping someone can answer this question, for I have checked many forums and have not come across any answers.我希望有人能回答这个问题,因为我检查了很多论坛并没有遇到任何答案。

Setup: Mac Big Sur Application used: Terminal设置:Mac Big Sur 使用的应用程序:终端

Goal: I am trying to get my active git directory to show the current branch that I am on.目标:我试图让我的活动 git 目录显示我所在的当前分支。

Her is a screen shot of the issue and also the content of.bash_profile她是问题的截图,也是.bash_profile的内容

  • As you can tell I have tried multiple exports and for what I can tell they all follow the basic structure如您所知,我尝试了多次导出,并且据我所知,它们都遵循基本结构

Any help on this matter would be very appreciated.对此问题的任何帮助将不胜感激。

在此处输入图像描述

在此处输入图像描述

Here is the screen shot with zprofile instead:这是使用 zprofile 的屏幕截图:
在此处输入图像描述

MacOS Big Sur is in zsh and the equivalent is ~/.zprofile MacOS Big Sur 在zsh中,相当于~/.zprofile
You can use:您可以使用:

cd $HOME
ls -a

To view all your hidden files.查看所有隐藏文件。 If you look closely, there is no .bash_profile , but there is instead a .zprofile .如果您仔细观察,没有.bash_profile ,而是有一个.zprofile Maybe this might help you:)也许这可能会帮助你:)

It turns out yes it is a problem with zsh.事实证明是的,这是 zsh 的问题。 I was using ash version.我用的是ash版本。 It needed a zsh version.它需要一个 zsh 版本。 Thanks for the help.谢谢您的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM