title: How to write a bash script that takes optional input arguments?
body: <p>I want my script to be able to take an optional input, </p>
  
  <p>e.g. currently my script is </p>
  
  <pre><code>#!/bin/bash
  somecommand foo
  </code></pre>
  
  <p>but I would like it to say:</p>
  
  <pre><code>#!/bin/bash
  somecommand  [ if $1 exists, $1, else, foo ]
  </code></pre>