title: Passing arguments to a command in Bash script with spaces
body: <p>I'm trying to pass 2 arguments to a command and each argument contains spaces, I've tried escaping the spaces in the args, I've tried wrapping in single quotes, I've tried escaping \" but nothing will work.</p>
  
  <p>Here's a simple example.</p>
  
  <pre><code>#!/bin/bash -xv
  
  ARG="/tmp/a b/1.txt"
  ARG2="/tmp/a b/2.txt"
  
  ARG_BOTH="\"$ARG\" \"$ARG2\""
  cat $ARG_BOTH
  </code></pre>
  
  <p>I'm getting the following when it runs:</p>
  
  <pre><code>ARG_BOTH="$ARG $ARG2"
  + ARG_BOTH='/tmp/a\ b/1.txt /tmp/a\ b/2.txt'
  cat $ARG_BOTH
  + cat '/tmp/a\' b/1.txt '/tmp/a\' b/2.txt
  cat: /tmp/a\: No such file or directory
  cat: b/1.txt: No such file or directory
  cat: /tmp/a\: No such file or directory
  cat: b/2.txt: No such file or directory
  </code></pre>