I have some difficulty understanding what is written in my ubuntu's .bashrc
which is shown in part below.
Here is what I don't understand :
What is the purpose of curly braces and the
-
/+
symbols used after:
? (ex. : ${debian_chroot:-} and ${debian_chroot:+($debian_chroot)})The
eval
command.How the following snippet of code works.
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi