Resolve SC2162: 'read without -r mangles backslashes'

More information:

https://github.com/koalaman/shellcheck/wiki/SC2162

http://wiki.bash-hackers.org/commands/builtin/read
This commit is contained in:
Dan Callahan
2015-11-02 17:13:44 -06:00
parent e1e7fbcc52
commit c389b213b5
12 changed files with 15 additions and 15 deletions

View File

@@ -111,7 +111,7 @@ case "$1" in
dokku_log_info1_quiet "Scaling for $APP"
dokku_col_log_info1_quiet "proctype" "qty"
dokku_col_log_info1_quiet "--------" "---"
while read line || [[ -n "$line" ]]; do
while read -r line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue
PROC_NAME=${line%%=*}
PROC_COUNT=${line#*=}

View File

@@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
print_dokku_scale_file() {
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
while read line || [[ -n "$line" ]]; do
while read -r line || [[ -n "$line" ]]; do
dokku_log_info2_quiet "$line"
done < "$DOKKU_SCALE_FILE"
}
@@ -25,7 +25,7 @@ generate_scale_file() {
if [[ ! -e "$PROCFILE" ]]; then
echo "web=1" >> $DOKKU_SCALE_FILE
else
while read line || [[ -n "$line" ]]; do
while read -r line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue
NAME=${line%%:*}
NUM_PROCS=0