mirror of https://github.com/octoleo/hosts.git
Use `read` with `-r` option.
ShellCheck SC2162: read without -r mangle backslashes https://github.com/koalaman/shellcheck/wiki/SC2162
This commit is contained in:
parent
4194b25459
commit
703d665a32
6
hosts
6
hosts
|
@ -523,12 +523,12 @@ desc() {
|
||||||
[[ -z ${1} ]] && _die printf "desc: No command name specified.\n"
|
[[ -z ${1} ]] && _die printf "desc: No command name specified.\n"
|
||||||
if [[ -n ${2:-} ]]
|
if [[ -n ${2:-} ]]
|
||||||
then
|
then
|
||||||
read -d '' "_desc_${1}" <<HEREDOC
|
read -r -d '' "_desc_${1}" <<HEREDOC
|
||||||
${2}
|
${2}
|
||||||
HEREDOC
|
HEREDOC
|
||||||
_debug printf "desc() set with argument: _desc_%s\n" "${1}"
|
_debug printf "desc() set with argument: _desc_%s\n" "${1}"
|
||||||
else
|
else
|
||||||
read -d '' "_desc_${1}"
|
read -r -d '' "_desc_${1}"
|
||||||
_debug printf "desc() set with pipe: _desc_%s\n" "${1}"
|
_debug printf "desc() set with pipe: _desc_%s\n" "${1}"
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
@ -1037,7 +1037,7 @@ remove() {
|
||||||
printf "Removing the following records:\n%s\n" "${target_records}"
|
printf "Removing the following records:\n%s\n" "${target_records}"
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -p "Are you sure you want to proceed? [y/N] " yn
|
read -r -p "Are you sure you want to proceed? [y/N] " yn
|
||||||
case ${yn} in
|
case ${yn} in
|
||||||
[Yy]* )
|
[Yy]* )
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue