title: Prevent ssh from breaking up shell script parameters
body: <p>I have a script, which is essentially a wrapper around an executable by the same name on a different machine. For the sake of example, i'll wrap printf here. My current script looks like this:</p>
  
  <pre><code>#!/bin/bash
  ssh user@hostname.tld. printf "$@"
  </code></pre>
  
  <p>Unfortunately, this breaks when one of the arguments contains a space, e.g. i'd expect the following commands to give identical outputs.:</p>
  
  <pre><code>~$ ./wrap_printf "%s_%s" "hello world" "1"
  hello_world1_
  ~$ printf "%s_%s" "hello world" "1"
  hello world_1
  </code></pre>
  
  <p>The problem gets even worse when (escaped) newlines are involved. How would I properly escape my arguments here?</p>