Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

printf "%i\n" 7 outputs extra newline



Greetings,

When I run 

printf '%i' 7

I get a 7, but with a newline both before and after it. I get the same
thing if I use /usr/bin/printf (by first running disable printf.)

However, if I use any other combination of shell and printf I get just a
7 with a newline after it, and no newline before it. I've tried ksh with
builtin and /usr/bin/printf; bash with both printf commands, and fish
with /usr/bin/printf (fish has no builtin printf.)

Is anyone getting the same result? Is there a good explanation for this?
Especially strange to me is how /usr/bin/printf seems to behave
differently in zsh than in other shells.  Thanks.

Omari



Messages sorted by: Reverse Date, Date, Thread, Author