aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-06-21 11:26:23 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-06-21 11:26:23 +1200
commit685234af1f48e976fd57ec04d4a253bcabfad4ea (patch)
treee8b232b7d2a9ffc9f18b5fa82667277ceff98e0b /bash/bashrc.d
parent6bcb7df3118f8a752b16bdb98838855303ab164a (diff)
downloaddotfiles-685234af1f48e976fd57ec04d4a253bcabfad4ea.tar.gz
dotfiles-685234af1f48e976fd57ec04d4a253bcabfad4ea.zip
Remove unneeded linebreak backslashes
Handy command: $ find bin sh bash -type f -exec grep \ -e '|| \\$' \ -e '&& \\$' \ -e '^\s*||' \ -e '^\s*&&' \ {} +
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/keep.bash6
-rw-r--r--bash/bashrc.d/path.bash3
-rw-r--r--bash/bashrc.d/prompt.bash16
3 files changed, 11 insertions, 14 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash
index 28b3e8f7..c7e42e04 100644
--- a/bash/bashrc.d/keep.bash
+++ b/bash/bashrc.d/keep.bash
@@ -103,8 +103,7 @@ EOF
# If -d was given, delete the keep files for the NAME
if ((delete)) ; then
- rm -- "$bashkeep"/"$name".bash \
- || ((errors++))
+ rm -- "$bashkeep"/"$name".bash || ((errors++))
# Otherwise, attempt to create the keep file, using an
# appropriate call to the declare builtin
@@ -116,8 +115,7 @@ EOF
*)
declare -p -- "$name"
;;
- esac ; } > "$bashkeep"/"$name".bash \
- || ((errors++))
+ esac ; } > "$bashkeep"/"$name".bash || ((errors++))
fi
;;
esac
diff --git a/bash/bashrc.d/path.bash b/bash/bashrc.d/path.bash
index d705b0ca..5f78e20e 100644
--- a/bash/bashrc.d/path.bash
+++ b/bash/bashrc.d/path.bash
@@ -225,8 +225,7 @@ _path() {
IFS=: read -d '' -a promptarr < <(printf '%s\0' "$PATH")
local part
for part in "${promptarr[@]}" ; do
- [[ $part == "${COMP_WORDS[COMP_CWORD]}"* ]] \
- || continue
+ [[ $part == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue
COMPREPLY[${#COMPREPLY[@]}]=$(printf '%q\0' "$part")
done
;;
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index eee81d95..6d90547f 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -53,10 +53,10 @@ prompt() {
256)
format=$( {
: "${PROMPT_COLOR:=10}"
- tput AF "$PROMPT_COLOR" \
- || tput setaf "$PROMPT_COLOR" \
- || tput AF "$PROMPT_COLOR" 0 0 \
- || tput setaf "$PROMPT_COLOR" 0 0
+ tput AF "$PROMPT_COLOR" ||
+ tput setaf "$PROMPT_COLOR" ||
+ tput AF "$PROMPT_COLOR" 0 0 ||
+ tput setaf "$PROMPT_COLOR" 0 0
} 2>/dev/null )
;;
@@ -64,8 +64,8 @@ prompt() {
8)
format=$( {
: "${PROMPT_COLOR:=2}"
- tput AF "$PROMPT_COLOR" \
- || tput setaf "$PROMPT_COLOR"
+ tput AF "$PROMPT_COLOR" ||
+ tput setaf "$PROMPT_COLOR"
tput md || tput bold
} 2>/dev/null )
;;
@@ -104,8 +104,8 @@ prompt() {
# Attempt to determine git branch, bail if we can't
local branch
branch=$( {
- git symbolic-ref --quiet HEAD \
- || git rev-parse --short HEAD
+ git symbolic-ref --quiet HEAD ||
+ git rev-parse --short HEAD
} 2>/dev/null )
if [[ ! -n $branch ]] ; then
return 1