aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bash_profile4
-rw-r--r--bash/bashrc4
-rw-r--r--bash/bashrc.d/cd.bash2
-rw-r--r--bash/bashrc.d/grep.bash8
-rw-r--r--bash/bashrc.d/ls.bash4
-rw-r--r--bash/bashrc.d/prompt.bash6
-rwxr-xr-xinstall2
7 files changed, 15 insertions, 15 deletions
diff --git a/bash/bash_profile b/bash/bash_profile
index 4594b77b..3d50e437 100644
--- a/bash/bash_profile
+++ b/bash/bash_profile
@@ -1,10 +1,10 @@
# Source Bourne shell profile if it exists
-if [[ -r "$HOME/.profile" ]]; then
+if [[ -r $HOME/.profile ]]; then
source "$HOME/.profile"
fi
# Source interactive Bash config if it exists
-if [[ -r "$HOME/.bashrc" ]]; then
+if [[ -r $HOME/.bashrc ]]; then
source "$HOME/.bashrc"
fi
diff --git a/bash/bashrc b/bash/bashrc
index 7952358c..c270fdfd 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -1,5 +1,5 @@
# Don't do anything if not running interactively
-if [[ -z "$PS1" ]]; then
+if [[ -z $PS1 ]]; then
return
fi
@@ -32,7 +32,7 @@ if [[ -r /etc/bash_completion ]]; then
fi
# Load any supplementary scripts
-if [[ -d "$HOME/.bashrc.d" ]]; then
+if [[ -d $HOME/.bashrc.d ]]; then
for file in "$HOME/.bashrc.d"/*; do
source "$file"
done
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 1813a9da..282e1649 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -7,7 +7,7 @@ __cd() {
done
shift $(($OPTIND-1))
if (($# == 2)); then
- if [[ "$PWD" == *"$1"* ]]; then
+ if [[ $PWD == *$1* ]]; then
builtin cd "${opts[@]}" "${PWD/$1/$2}"
else
printf "bash: cd: could not replace substring\n" >&2
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash
index 656e3c77..4bd2ed5e 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -11,24 +11,24 @@ __grepopts() {
grepopts[${#grepopts[@]}]='-I'
# If the --exclude option is available, exclude some VCS files
- if [[ "$grephelp" == *--exclude* ]]; then
+ if [[ $grephelp == *--exclude* ]]; then
grepopts[${#grepopts[@]}]='--exclude=.git{,ignore,modules}'
fi
# If the --exclude option is available, exclude some VCS dirs
- if [[ "$grephelp" == *--exclude-dir* ]]; then
+ if [[ $grephelp == *--exclude-dir* ]]; then
grepopts[${#grepopts[@]}]='--exclude-dir=.{cvs,git,hg,svn}'
fi
# If the --color option is available and we have a terminal that supports
# at least eight colors, add --color=auto to the options
local -i colors="$(tput colors)"
- if [[ "$grephelp" == *--color* ]] && ((colors >= 8)); then
+ if [[ $grephelp == *--color* ]] && ((colors >= 8)); then
grepopts[${#grepopts[@]}]='--color=auto'
fi
# Print the options as a single string, space-delimited
- printf -- "${grepopts[*]}"
+ printf '%s' "${grepopts[*]}"
}
# Alias grep with those options
diff --git a/bash/bashrc.d/ls.bash b/bash/bashrc.d/ls.bash
index 356be541..93d6a9ec 100644
--- a/bash/bashrc.d/ls.bash
+++ b/bash/bashrc.d/ls.bash
@@ -10,12 +10,12 @@ __lsopts() {
# If the --color option is available and we have a terminal that supports
# at least eight colors, add --color=auto to the options
local -i colors="$(tput colors)"
- if [[ "$lshelp" == *--color* ]] && ((colors >= 8)); then
+ if [[ $lshelp == *--color* ]] && ((colors >= 8)); then
lsopts[${#lsopts[@]}]='--color=auto'
fi
# Print the options as a single string, space-delimited
- printf -- "${lsopts[*]}"
+ printf '%s' "${lsopts[*]}"
}
# Alias ls with these options
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 9b23c044..23c9d64b 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -96,7 +96,7 @@ prompt() {
# If there are changes in the tree, add an exclamation mark to the
# state
- if [[ -n "$(hg status 2>/dev/null)" ]]; then
+ if [[ -n $(hg status 2>/dev/null) ]]; then
state="!"
fi
@@ -129,7 +129,7 @@ prompt() {
# If there are changes in the working directory, add an exclamation
# mark to the state
- if [[ -n "$(svn status 2>/dev/null)" ]]; then
+ if [[ -n $(svn status 2>/dev/null) ]]; then
state="!"
fi
@@ -151,7 +151,7 @@ prompt() {
# Show the count of background jobs in curly brackets
job)
- if [[ -n "$(jobs)" ]]; then
+ if [[ -n $(jobs) ]]; then
printf '{%d}' "$(jobs | sed -n '$=')"
fi
;;
diff --git a/install b/install
index 7b93905e..a8d870fe 100755
--- a/install
+++ b/install
@@ -2,7 +2,7 @@
# Define dotfiles directory and check it exists
dotfiles="$HOME/.dotfiles"
-if [[ ! -n "$dotfiles" ]]; then
+if [[ ! -n $dotfiles ]]; then
printf "Could not find $dotfiles!\n" >&2
exit 1
fi