simplify printf call

Signed-off-by: Dave Rodgman <[email protected]>
This commit is contained in:
Dave Rodgman
2024-02-29 14:13:35 +00:00
parent b93ae3b453
commit c2a27492bc
+1 -1
View File
@@ -30,7 +30,7 @@ print_quoted_args() {
# but produce more human-readable results for common/simple cases like "a b"
for a in "$@"; do
# Get bash to quote the string
q=$(printf '%q' "$a")
printf -v q '%q' "$a"
simple_pattern="^([-[:alnum:]_+./:@]+=)?([^']*)$"
if [[ "$a" != "$q" && $a =~ $simple_pattern ]]; then
# a requires some quoting (a != q), but has no single quotes, so we can