Printf "-=" is recognized as an option and not a format string
laurenthuberdeau opened this issue · 0 comments
laurenthuberdeau commented
Bug
➜ ksh -E 'printf "-="'
ksh: printf: -=: unknown option
Usage: printf [ options ] format [string ...]
Escaping the leading -
makes it print -=
as expected:
➜ ksh -E 'printf "\-="'
-=%
But not on dash, which prints the \
:
➜ dash -c 'printf "-="'
dash: 1: printf: Illegal option -=
➜ dash -c 'printf "\-="'
\-=%