title: Inside shell script: write Python output to file works from terminal, "Input stream is empty" when running from launchd
body: <p>I wrote a short shell script to write the contents of an Evernote note to a file with Geeknote, which runs under python:</p>
  
  <pre><code>#!/bin/bash
  /usr/bin/python /Users/me/Git/geeknote/geeknote.py find --search "Hobbies To Do" &gt; /dev/null
  /usr/bin/python -u /Users/me/Git/geeknote/geeknote.py show "Hobbies To Do" | tee /Users/me/Programming/output.txt
  </code></pre>
  
  <p>The script works fine when I run it from terminal (it writes the output of the second python command to output.txt), although ideally I'd like the script to run periodically on its own. So I tried creating a .plist/LaunchAgent to run the script, but when I do that the only thing that gets written to output.txt is <code>Input stream is empty</code>...can't figure out why. Right now my .plist looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.me.geektoolcron&lt;/string&gt;
  
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;/Users/me/Programming/script.sh&lt;/string&gt;
    &lt;/array&gt;
  
    &lt;key&gt;StartInterval&lt;/key&gt;
    &lt;integer&gt;10&lt;/integer&gt;
  
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>