mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 22:55:10 +01:00
Fixed quoting of commands and variables
This commit is contained in:
14
.bashrc
14
.bashrc
@@ -59,7 +59,7 @@ fi
|
|||||||
# http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format
|
# http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format
|
||||||
# returns 0 if =, 1 if >, 2 if <
|
# returns 0 if =, 1 if >, 2 if <
|
||||||
vercomp () {
|
vercomp () {
|
||||||
if [[ $1 == $2 ]]
|
if [[ "$1" == "$2" ]]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -90,7 +90,7 @@ vercomp () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# check version of git; it supports 'simple' from 1.7.11 up, fall back to 'matching'
|
# check version of git; it supports 'simple' from 1.7.11 up, fall back to 'matching'
|
||||||
vercomp "1.7.11" `git --version|awk '{ print $3 }'`
|
vercomp "1.7.11" "$(git --version|awk '{ print $3 }')"
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
git config --global push.default matching
|
git config --global push.default matching
|
||||||
git config --global pull.default matching
|
git config --global pull.default matching
|
||||||
@@ -108,8 +108,8 @@ set_bash_prompt(){
|
|||||||
YELLOW="\[\033[0;33m\]"
|
YELLOW="\[\033[0;33m\]"
|
||||||
GREEN="\[\033[0;32m\]"
|
GREEN="\[\033[0;32m\]"
|
||||||
RED="\[\033[0;31m\]"
|
RED="\[\033[0;31m\]"
|
||||||
PROMPT_SYMBOL='$'
|
#PROMPT_SYMBOL='$'
|
||||||
if [ $USER = 'root' ]; then
|
if [ "$USER" = 'root' ]; then
|
||||||
#PS1="$YELLOW\t $RED\u$BLACK@\h:\W# "
|
#PS1="$YELLOW\t $RED\u$BLACK@\h:\W# "
|
||||||
PS1="${debian_chroot:+$debian_chroot }$(venvinfo)$YELLOW\t $RED\u$BLACK@\h:\W$(jobscount)# "
|
PS1="${debian_chroot:+$debian_chroot }$(venvinfo)$YELLOW\t $RED\u$BLACK@\h:\W$(jobscount)# "
|
||||||
elif [ -e ~/.dot_is_server ]; then
|
elif [ -e ~/.dot_is_server ]; then
|
||||||
@@ -133,12 +133,12 @@ jobscount() {
|
|||||||
|
|
||||||
venvinfo() {
|
venvinfo() {
|
||||||
# Virtualenv information
|
# Virtualenv information
|
||||||
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
|
if [ "$(basename "$VIRTUAL_ENV")" = "__" ]; then
|
||||||
# special case for Aspen magic directories
|
# special case for Aspen magic directories
|
||||||
# see http://www.zetadev.com/software/aspen/
|
# see http://www.zetadev.com/software/aspen/
|
||||||
echo "[`basename \`dirname \"$VIRTUAL_ENV\"\``] "
|
echo "[$(basename "$(dirname "$VIRTUAL_ENV")")] "
|
||||||
elif [ "$VIRTUAL_ENV" != "" ]; then
|
elif [ "$VIRTUAL_ENV" != "" ]; then
|
||||||
echo "(`basename \"$VIRTUAL_ENV\"`) "
|
echo "($(basename "$VIRTUAL_ENV")) "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user