title: Conditionals in POSIX standards
body: <p>In these days I spent a lot of time reading various articles and guides about scripting (most of all in Bash). One of the first things that came up was that the best thing to do was sticking to POSIX, for portability.</p>
  <p>Anyway, I couldn't get the standard way to make a conditional statement straight... I would like to ignore <code>test</code> in this post and discuss <code>[</code> and <code>[[</code> instead.</p>
  <p>I found that <code>[</code> is a bit dated, but every shell supports it (older as alias of <code>/bin/test/</code>, &quot;newer&quot; as part of the shell themselves).</p>
  <p>On the other hand, almost every tutorial I found use <code>[[</code>, and, when asked, the reason is something like &quot;Bash is default in most of Linux distributions, so it's like a standard&quot;.</p>
  <p>There are, of course, a lot of differences between them and personally I found <code>[[</code> easier to use.</p>
  <p>What is the standard way to make a conditional statement? And if a standard way isn't defined: What is the best way? I have to achieve portability, not readability or easiness...</p>
  <p>What is the position on &quot;Bash is a de facto standard&quot; and is it really safe to use it as a standard rather than only POSIX rules?</p>