编辑 .bash_profile 后无法登录 bash

编辑 .bash_profile 后无法登录 bash

我摆弄了一下我的.profile.bash_profile加快了一些事情: PATH=$PATH:/home/yoshi/android-sdk-linux/platform-tools

首先,我将这行代码添加到 my .profileand perfect 中。然后我阅读了评论:

> # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
> # exists.

好主意!所以我把它移到了那里(必须创建它)。这就是麻烦的开始。我通过编辑nano,关闭文件和终端窗口。从启动器启动新窗口,空白屏幕上出现一个孤独的光标闪烁。不典型foo@bar:~$
切换到tty会话时出现同样的问题。

可以重新启动,现在我可以登录到ttyshell,尽管它首先保持空白,我必须通过 中断某些操作 (?) CTRL+C。遗憾的是,这种魔法在 unity 的终端上不起作用。 :(

我的 的相关部分.profile。我已删除.bash_profile

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

答案1

我认为我需要为此获得一个奖励。

不知道ubuntu也有一个.profile默认的我已经编辑source .profile到末尾.bashrc

=> ∞

配置文件名为.bashrc,谁调用配置文件,哪个调用.bashrc.... ... 捂脸

我设法通过记录执行情况找到了这个循环.profile。添加位置合适的代码echo "including X/finding Y"总是会发现相同的模式:[...] echo "include .bashrc"这让我想到了恶作剧的source .profile-line :)

相关内容