[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"printf -v foo bar" sets $? to 1
From: |
Keith Thompson |
Subject: |
"printf -v foo bar" sets $? to 1 |
Date: |
Sat, 14 Aug 2021 16:56:52 -0700 |
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Linux bomb20 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9
22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.1
Patch Level: 4
Release Status: maint
Description:
The builtin "printf" command with the "-v" option works
correctly, but it reports failure by setting $? to 1.
The problem was introduced by this commit; I've confirmed
that it doesn't occur with its immediate predecessor.
commit a30f513fc4cd507e74de6f0d0006b289a017a0d0
Author: Chet Ramey <chet.ramey@case.edu>
Date: 2021-05-13 14:49:18 -0400
more changes to handle @ and * as associative array keys
Repeat-By:
if printf -v foo bar ; then echo OK ; else echo FAILED ; fi
- "printf -v foo bar" sets $? to 1,
Keith Thompson <=