title: How to create a bash script with optional parameters for a flag
body: <p>I'm trying to create a script which will have a flag with optional options. With getopts it's possible to specify a mandatory argument (using a colon) after the flag, but I want to keep it optional.</p>
  
  <p>It will be something like this: </p>
  
  <pre><code>./install.sh -a 3
  </code></pre>
  
  <p>or</p>
  
  <pre><code>./install.sh -a3
  </code></pre>
  
  <p>where 'a' is the flag and '3' is the optional parameter that follows a.</p>
  
  <p>Thanks in advance.</p>