./txtdb: строка 9: [:=: ожидается унарный оператор

Решено заменой \wи \Wв PS1на $PWD:

.
if [ "$color_prompt" = yes ]; then
    if [[ ${EUID} == 0 ]] ; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] $PWD \$\[\033[00m\] '
    else
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]$PWD \$\[\033[00m\] '
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h $PWD \$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h \$PWD\a\]$PS1"
    ;;
*)
    ;;
esac
1
15.02.2020, 12:36
1 ответ

Укажите свои переменные.

С незакавыченной и пустой переменной

[ $UserChoice -eq 1 ]
-bash: [: -eq: unary operator expected

С кавычками, но пустыми переменными

[ "$UserChoice" -eq 1 ]
-bash: [: : integer expression expected
2
28.04.2021, 23:23

Теги

Похожие вопросы