Dear DEV TEAM,

I want to report a strange *printf* behaviour which appears in debug mode +
no arguments.

OS: Debian GNU/Linux 12 (bookworm)
BASH_VERSION="5.2.15(1)-release"

OS: MACOS
BASH_VERSION="5.2.21(1)-release"

The culprit function is *printargs() { printf "%s|" "$@"; echo; }*

calling it with no arguments it prints as expected the pipe: "|"
while in debug mode (set -x), only a *blank line* is printed:

$ printargs
printargs
+ printargs
+ printf %sx
x+ echo

$

I noticed that the expected pipe is printed in case of:

   1. adding a new line after the pipe
   printargs() { printf "%s|*\n*" "$@"; echo; }
   2. suppressing STDERR
   printargs *2>/dev/null*

Could you check it out too, please?
With much consideration and gratitude - thank you!

Reply via email to