git-completion.bash 和 .bash_profile 错误

git-completion.bash and .bash_profile Erro

我试图编辑我的 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 '"'
<username>-MacBook-Air-2:~ <username>$ 

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

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

请帮忙。谢谢!

P.S。我正在使用 MacBook Air OSX Yosemite 版本 10.10.3

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

source ~/bin/git-completion.bash

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

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