Neat tricks, thanks for sharing!<p>In case anyone&#x27;s interested, I recently came across a neat trick in Bash to make sure the user specifies a command line argument.<p>Instead of:<p><pre><code>  if [ -z &quot;$1&quot; ]; then echo &quot;Error!!&quot;; exit; fi
</code></pre>
This basically does the same thing and is more elegant (especially if you need to do this for many arguments):<p><pre><code>  var=${1?Error!!}
</code></pre>
If the user specifies an argument, it will be saved in $var; if not, Bash will output an error message and will stop execution of the program.