mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-03 19:54:12 -04:00
fix: avoid echo usage
Echo can interpret operand as an option and checking every variable to be echoed is troublesome while with printf, if the format specifier is present before the operand, printing as string can be enforced.
This commit is contained in:
parent
1b2f1ba941
commit
bdd4c789c1
52 changed files with 318 additions and 270 deletions
|
@ -22,7 +22,7 @@ check_installed(){
|
|||
for prog in "${@}"; do
|
||||
# shellcheck disable=SC2310
|
||||
if ! has "${prog}"; then
|
||||
echo "Missing program: ${prog}" >&2
|
||||
printf '%s\n' "Missing program: ${prog}" >&2
|
||||
missing_programs=1
|
||||
fi
|
||||
done
|
||||
|
@ -33,11 +33,11 @@ check_installed(){
|
|||
|
||||
validate_dir(){
|
||||
if ! test -d "${dir}"; then
|
||||
echo "Directory '${dir}' does not exist" >&2
|
||||
printf '%s\n' "Directory '${dir}' does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! test -w "${dir}"; then
|
||||
echo "Directory '${dir}' is not writable" >&2
|
||||
printf '%s\n' "Directory '${dir}' is not writable" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -84,9 +84,9 @@ gettxout(){
|
|||
}
|
||||
|
||||
usage(){
|
||||
echo "Usage: ${0##*/} getblock|getrawtransaction|gettxout [DIR]"
|
||||
echo "Note: gettxout works with pruned node"
|
||||
echo "Note: DIR defaults to \${HOME}"
|
||||
printf '%s\n' "Usage: ${0##*/} getblock|getrawtransaction|gettxout [DIR]"
|
||||
printf '%s\n' "Note: gettxout works with pruned node"
|
||||
printf '%s\n' "Note: DIR defaults to \${HOME}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue