LINUX.ORG.RU

История изменений

Исправление Kroz, (текущая версия) :

OMG! что такое PROMPT ? Что за шелл?

В bash подсказка однозначно определяется переменной PS1:

$ echo "$PS1"
\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> 
(ну, есть и другие PS*, но мы сейчас не об этом).

Не знаю что там в Аrch, но в Gentoo этому не место.

Вот полный кусок, который отвечает за подсказку из /etc/bash/bashrc (у тебя похожее, я немного модифицировал):

...
if ${use_color} ; then
        # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
        if type -P dircolors >/dev/null ; then
                if [[ -f ~/.dir_colors ]] ; then
                        eval $(dircolors -b ~/.dir_colors)
                elif [[ -f /etc/DIR_COLORS ]] ; then
                        eval $(dircolors -b /etc/DIR_COLORS)
                fi
        fi

        if [[ ${EUID} == 0 ]] ; then
                #PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
                PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        else
                #PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
                PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        fi

        alias ls='ls --color=auto'
        alias grep='grep --colour=auto'
        alias l='ls -la --color=auto'
else
        if [[ ${EUID} == 0 ]] ; then
                # show root@ when we don't have colors
                PS1='\u@\h \W \$ '
        else
                PS1='\u@\h \w \$ '
        fi
        alias l='ls -la'
fi

Исправление Kroz, :

OMG! что такое PROMPT ? Что за шелл?

В bash подсказка однозначно определяется переменной PS1:

$ echo "$PS1"
\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> 
(ну, есть и другие PS*, но мы сейчас не об этом).

Не знаю что там в Аrch, но в Gentoo ему не место.

Вот полный кусок, который отвечает за подсказку из /etc/bash/bashrc (у тебя похожее, я немного модифицировал):

...
if ${use_color} ; then
        # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
        if type -P dircolors >/dev/null ; then
                if [[ -f ~/.dir_colors ]] ; then
                        eval $(dircolors -b ~/.dir_colors)
                elif [[ -f /etc/DIR_COLORS ]] ; then
                        eval $(dircolors -b /etc/DIR_COLORS)
                fi
        fi

        if [[ ${EUID} == 0 ]] ; then
                #PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
                PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        else
                #PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
                PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        fi

        alias ls='ls --color=auto'
        alias grep='grep --colour=auto'
        alias l='ls -la --color=auto'
else
        if [[ ${EUID} == 0 ]] ; then
                # show root@ when we don't have colors
                PS1='\u@\h \W \$ '
        else
                PS1='\u@\h \w \$ '
        fi
        alias l='ls -la'
fi

Исправление Kroz, :

OMG! что такое PROMPT ? Что за шелл?

В bash подсказка однозначно определяется переменной PS1:

$ echo "$PS1"
\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> 
(ну, есть и другие PS*, но мы сейчас не об этом).

Не знаю что там в Аrch, но в Gentoo оно приносит дополнительные проблемы.

Вот полный кусок, который отвечает за подсказку из /etc/bash/bashrc (у тебя похожее, я немного модифицировал):

...
if ${use_color} ; then
        # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
        if type -P dircolors >/dev/null ; then
                if [[ -f ~/.dir_colors ]] ; then
                        eval $(dircolors -b ~/.dir_colors)
                elif [[ -f /etc/DIR_COLORS ]] ; then
                        eval $(dircolors -b /etc/DIR_COLORS)
                fi
        fi

        if [[ ${EUID} == 0 ]] ; then
                #PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
                PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        else
                #PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
                PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        fi

        alias ls='ls --color=auto'
        alias grep='grep --colour=auto'
        alias l='ls -la --color=auto'
else
        if [[ ${EUID} == 0 ]] ; then
                # show root@ when we don't have colors
                PS1='\u@\h \W \$ '
        else
                PS1='\u@\h \w \$ '
        fi
        alias l='ls -la'
fi

Исходная версия Kroz, :

OMG! что такое PROMPT ? Что за шелл?

Что бы это ни было, оно не знает что такое %p

В bash подсказка однозначно определяется переменной PS1:

$ echo "$PS1"
\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> 
(ну, есть и другие PS*, но мы сейчас не об этом).

Не знаю что там в Аrch, но в Gentoo оно приносит дополнительные проблемы.

Вот полный кусок, который отвечает за подсказку из /etc/bash/bashrc (у тебя похожее, я немного модифицировал):

...
if ${use_color} ; then
        # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
        if type -P dircolors >/dev/null ; then
                if [[ -f ~/.dir_colors ]] ; then
                        eval $(dircolors -b ~/.dir_colors)
                elif [[ -f /etc/DIR_COLORS ]] ; then
                        eval $(dircolors -b /etc/DIR_COLORS)
                fi
        fi

        if [[ ${EUID} == 0 ]] ; then
                #PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
                PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        else
                #PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
                PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]> '
        fi

        alias ls='ls --color=auto'
        alias grep='grep --colour=auto'
        alias l='ls -la --color=auto'
else
        if [[ ${EUID} == 0 ]] ; then
                # show root@ when we don't have colors
                PS1='\u@\h \W \$ '
        else
                PS1='\u@\h \w \$ '
        fi
        alias l='ls -la'
fi