我想在bash 中使用powerline(不是zsh如果可能,),但我遇到了一些错误,以下是我已完成的步骤
我最近使用自制软件安装了python
我也执行了 brew linkapps python
我已经安装了powerline-statys使用pip install powerline-status
我已经扩展了我的~/.bash_profile
if [ -f /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
fi
Run Code Online (Sandbox Code Playgroud)
我还使用它从https://github.com/powerline/fonts安装了修补字体install.sh
经过Opennig新标签iTerm2我面临这个错误,我认为这是关于蟒蛇,但我没有想法如何解决它,所以请大家帮忙
traceback (most recent call last):
File "/usr/local/bin/powerline-config", line 6, in <module>
from powerline.commands.config import get_argparser
File "/usr/local/lib/python2.7/site-packages/powerline/commands/config.py", line 6, in <module>
import powerline.bindings.config as config
File "/usr/local/lib/python2.7/site-packages/powerline/bindings/config.py", line 19, in <module>
from powerline.commands.main import finish_args
File "/usr/local/lib/python2.7/site-packages/powerline/commands/main.py", line …Run Code Online (Sandbox Code Playgroud) 我正在尝试制作一个在设置环境变量时会发生变化的 PS1
我试过这两种方法都没有成功:
PS1_EMOJI=
update_ps1_emoji() {
if [ "$ENV_VAR" != "" ]; then
PS1_EMOJI=
fi
}
PROMPT_COMMAND='update_ps1_emoji'
export PS1="\[\e[0;35m\]$PS1_EMOJI [\W]\$?\[\e[m\e[0;31m\]$\[\e[m\] "
Run Code Online (Sandbox Code Playgroud)
和
ps1_emoji() {
if [ "$ENV_VAR" != "" ]; then
echo -n ""
else
echo -n ""
fi
}
export PS1="\[\e[0;35m\]`ps1_emoji` [\W]\$?\[\e[m\e[0;31m\]$\[\e[m\] "
Run Code Online (Sandbox Code Playgroud)
设置环境变量并重新采购 .bashrc 会更新提示。
所以我正在为我的bash配置文件添加一条路径,我不小心用"myname 1"而不是"myname1"启动了它.我觉得这个空间搞砸了.
当我现在打开终端时,我得到:
-bash: export: `1/Documents/android-sdk-macosx/platform-tools:/Users/XXXX/Library/PreferencePanes/MMPane.prefPane/Contents/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin': not a valid identifier
-bash: dirname: command not found
-bash: /Users/bin/git-prompt.sh: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我知道'1 /是超级混乱,但现在当我再次尝试编辑配置文件时,没有任何作用.我无法使用nano或任何东西访问它.我甚至认为它不能再找到我的个人资料了.
有谁知道我如何访问旧的配置文件来修复我做的编辑?
我想通过C程序在bash中设置路径环境变量.所以我使用'setenv'函数编码,但它不是解决的答案.
任何人都可以提出另一种方法来解决C编程中的这个问题吗?
我认为程序读取配置文件的另一个解决方案,然后修改并保存,但实际上当我打开这个文件时,我没有关于PATH变量的字符串.
我正在尝试安装Postgres以使用Heroku。
我按照Heroku教程中的说明进行操作,并且在安装Postgres之后(成功),它说要配置.bash_profile以允许Postgres命令行功能。
我正在按照此处的说明进行操作,但是无法成功添加以下行:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
Run Code Online (Sandbox Code Playgroud)
该文件夹实际上在我的计算机上确实包含“ psql”,因此它应该可以工作。这是我当前的.bash_profile:
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# The next line updates PATH for the Google Cloud SDK.
source '/Users/user/google-cloud-sdk/path.bash.inc'
# The next line enables shell command completion for gcloud.
source '/Users/user/google-cloud-sdk/completion.bash.inc'
Run Code Online (Sandbox Code Playgroud)
我试图将Postgres行添加到该文件的末尾,但是它不起作用。在线搜索之后,关于如何向.bash_profile中添加PATH似乎尚未达成共识。我尝试了列出的许多版本,但没有一个起作用。
如果我做错了,请告诉我!
重要信息:请参阅下面的更新-1,建议新的目录结构.
重要提示:请参阅下面的更新-2以了解我为什么要查找bash_script来编写我的书.
重要信息:请参阅update-3,了解是否需要与addPage()分开的insertPage()命令.
最后更新:这是我用这个脚本写的书!:六十秒演示
我手动写书,它有以下directory结构:
The-Solar-System/
??? README.md
??? css
? ??? page-1
? ? ??? style.css
? ??? page-2
? ? ??? style.css
? ??? page-3
? ??? style.css
??? head
? ??? page-1
? ? ??? head.html
? ??? page-2
? ? ??? head.html
? ??? page-3
? ??? head.html
??? html
? ??? page-1
? ? ??? body.html
? ??? page-2
? ? ??? body.html
? ??? page-3 …Run Code Online (Sandbox Code Playgroud) bash ×5
c ×1
env ×1
heroku ×1
linux ×1
osx-yosemite ×1
postgresql ×1
powerline ×1
psql ×1
shell ×1