From 443643200d728b4947349b13e2345ec9ae82d203 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 23 Aug 2016 20:22:47 +1200 Subject: Add -r to read to placate shellcheck --- bash/bash_completion.d/bd.bash | 2 +- bash/bash_completion.d/make.bash | 2 +- bash/bash_completion.d/path.bash | 2 +- bash/bashrc.d/prompt.bash | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'bash') diff --git a/bash/bash_completion.d/bd.bash b/bash/bash_completion.d/bd.bash index 7f4ae107..4b3d4a94 100644 --- a/bash/bash_completion.d/bd.bash +++ b/bash/bash_completion.d/bd.bash @@ -6,7 +6,7 @@ _bd() { # Build a list of dirnames in $PWD local -a dirnames - IFS=/ read -d '' -a dirnames < <(printf '%s\0' "${PWD#/}") + IFS=/ read -rd '' -a dirnames < <(printf '%s\0' "${PWD#/}") # Remove the last element in the array (the current directory) ((${#dirnames[@]})) || return 1 diff --git a/bash/bash_completion.d/make.bash b/bash/bash_completion.d/make.bash index ca209e8e..bf4ed268 100644 --- a/bash/bash_completion.d/make.bash +++ b/bash/bash_completion.d/make.bash @@ -15,7 +15,7 @@ _make() { # Break the target up with space delimiters local -a targets - IFS=' ' read -a targets -d '' < \ + IFS=' ' read -rd '' -a targets < \ <(printf '%s\0' "${line%%:*}") # Iterate through the targets and add suitable ones diff --git a/bash/bash_completion.d/path.bash b/bash/bash_completion.d/path.bash index b8bdc6aa..60b36844 100644 --- a/bash/bash_completion.d/path.bash +++ b/bash/bash_completion.d/path.bash @@ -41,7 +41,7 @@ _path() { # Complete with directories from PATH remove) local -a promptarr - IFS=: read -d '' -a promptarr < <(printf '%s\0' "$PATH") + IFS=: read -rd '' -a promptarr < <(printf '%s\0' "$PATH") local part for part in "${promptarr[@]}" ; do [[ $part == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 69801b90..ff8e4727 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -213,7 +213,7 @@ prompt() { # Show the count of background jobs in curly brackets, if not zero job) local -i jobc - while read ; do + while read -r ; do ((jobc++)) done < <(jobs -p) ((jobc)) && printf '{%u}' "$jobc" -- cgit v1.2.3