title: Create an 'at' job in a script
body: <p>In Ruby, I need to have a script queue up some <code>at</code> jobs. Making system calls is easy enough, I can use backticks, <code>system</code>, or <code>%x()</code>. But the <code>at</code> command is necessarily multi-line, and requires the command input <code>ctrl+d</code> to terminate. How can I create an <code>at</code> job dynamically?</p>
  
  <p>Example (Ruby):</p>
  
  <pre><code>`at #{time}\nrun_other_script.rb\n:q`
  </code></pre>
  
  <p>Effect:</p>
  
  <pre><code>at 2014-10-14 11:30
  at&gt; run_other_script.rb
  at&gt; &lt;EOT&gt;
  </code></pre>
  
  <p>But of course my example doesn't work. What does?</p>