Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 2
    Do you really need "${TEST}", can't it be "$TEST"? Commented May 16, 2019 at 17:15
  • 1
    "$TEST" is enough. Commented May 16, 2019 at 17:41
  • 3
    +1. But it's not just 'normal', it's necessary. Passing a variable to printf's first parameter is Christmas to hackers. Never do it. That is part of secure software dev 101. Commented May 16, 2019 at 21:24
  • @Jeffrey Most of the potential vulnerabilities in printf are only applicable to the C function. There aren't as many evil things you can do by passing a bad format string to /usr/bin/printf (or the equivalent shell builtin). Commented May 16, 2019 at 21:56
  • @duskwuff you can do variable assignment using bash's printf, and variable assignments can lead to a lot more (e.g., shellshock in days past) Commented May 17, 2019 at 1:56