title: How can I automatically quote or group commandline arguments for alias in bash?
body: <p>I have a script that takes a command and executes it on a remote host.  It works fine, for example:</p>
  
  <pre><code>$ rexec "ant build_all"
  </code></pre>
  
  <p>will execute the "ant build_all" command on the remote system (passing it through SSH, etc).</p>
  
  <p>Because I'm lazy, I want to set up an alias for this command (and ultimately, several others), such that, for example, I can just invoke</p>
  
  <pre><code>$ rant build_all
  </code></pre>
  
  <p>and bash will it will automatically invoke </p>
  
  <pre><code>$ rexec "ant build_all"
  </code></pre>
  
  <p>I tried doing this with alias, but if I define</p>
  
  <pre><code>alias rant=rexec ant
  </code></pre>
  
  <p>then any arguments passed to "rant" will just be appended to the end, like so:</p>
  
  <pre><code>$ rant build_all -Dtarget=Win32
  (interpreted as:)
  $ rexec "ant" build_all -Dtarget=Win32
  </code></pre>
  
  <p>This fails, because rexec really takes just one argument, and ignores the others.</p>
  
  <p>I could probably do this with a bash wrapper script, but I was wondering if bash had any built-ins for doing this for me, perhaps a named-argument version of alias, or a perl-like quote string command (e.g. qw/ / ), or some such.</p>