title: Build a command line from stored value in variable
body: <p>I am trying to build a commandline based on a variable VAR1.</p>
  
  <p>If its empty it needs to be set as --arg1 1, else --arg2 $VAR1</p>
  
  <p>This is a simple a script</p>
  
  <pre><code>#!/bin/bash -x
  
  export VAR1=1 # Setting this myself for now
  
  if [[ -z $VAR1 ]]
  then
      VAR2="--arg1 1"
  else
      VAR2="--arg2 \"$VAR1\""
  fi
  
  my_command $VAR2
  </code></pre>
  
  <p>When I execute this single quotes are added across $VAR1</p>
  
  <pre><code>my_command --arg2 '"1"'
  </code></pre>
  
  <p>I need the output to be</p>
  
  <pre><code>my_command --arg2 "1"
  </code></pre>
  
  <p>If you have better approach please do post.</p>