title: How to check existence of environment variable in BASH without passing it value to cmd?
body: <p>Basically, I have this if statement that doing all required stuff</p>
  <pre><code>if [ -z &quot;${x}&quot; ]; then
  echo &quot;You must set x variable, please see readme.md on how to get &amp; set this variable.&quot;
  exit 1
  fi
  </code></pre>
  <p>But I found a more cool solution:</p>
  <p><code>echo &quot;${x:?You must set x variable, please see readme.md on how to get &amp; set this variable.}</code></p>
  <p>It also works, but it has one major problem, if variable exist it print it to the cmd, is it possible to somehow show only error and if variable exist not to show it content?</p>
  <p>Is it possible to pass 2 variables in that 1 function?
  Something like that:</p>
  <p><code>echo &quot;${x,y:?You must set x,y variable, please see readme.md on how to get &amp; set this variable.}</code></p>