【问题标题】:git-completion.bash and .bash_profile Errogit-completion.bash 和 .bash_profile 错误
【发布时间】:2021-08-24 13:10:38
【问题描述】:

我试图编辑我的 bash 个人资料,但失败了。我试图在网上搜索答案,但没有运气。现在每次我打开终端时都会出现此消息。

Last login: Tue Jun 30 01:19:29 on ttys000
-bash: /Users/<username>/bin/git-completion.bash: No such file or directory
-bash: /Users/<username>/.bash_profile: line 114: syntax error near unexpected token `('
-bash: /Users/<username>/.bash_profile: line 114: `alias ip1="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"'
<username>-MacBook-Air-2:~ <username>$ 

我基本上试图复制并过去这个人的 bash 个人资料 Bash Profile(“结论”下的代码),但由于某种原因它不起作用,我在 Google 上搜索了如何通过复制并粘贴此代码来重置 bash 个人资料命令行

PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH" 
export PATH

请帮忙。谢谢!

附:我正在使用 MacBook Air OSX Yosemite 版本 10.10.3

【问题讨论】:

    标签: macos terminal osx-yosemite


    【解决方案1】:

    第一个错误是指他为自定义 bash 完成 git 命令而制作的文件。您可以删除它,最初是第 6 行:

    source ~/bin/git-completion.bash
    

    对于第二个错误,别名中有一些不需要的字符,将第114行更改为:

    alias ip1="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-10
      • 2021-09-16
      • 2019-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多