osx - Inside shell script: write Python output to file works from terminal, "Input stream is empty" when running from launchd -


i wrote short shell script write contents of evernote note file geeknote, runs under python:

#!/bin/bash /usr/bin/python /users/me/git/geeknote/geeknote.py find --search "hobbies do" > /dev/null /usr/bin/python -u /users/me/git/geeknote/geeknote.py show "hobbies do" | tee /users/me/programming/output.txt 

the script works fine when run terminal (it writes output of second python command output.txt), although ideally i'd script run periodically on own. tried creating .plist/launchagent run script, when thing gets written output.txt input stream empty...can't figure out why. right .plist looks this:

<?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict>   <key>label</key>   <string>com.me.geektoolcron</string>    <key>programarguments</key>   <array>     <string>/users/me/programming/script.sh</string>   </array>    <key>startinterval</key>   <integer>10</integer>    <key>runatload</key>   <true/> </dict> </plist> 

you try replacing second python command echo a or replacing tee redirection. script worked me same plist:

#!/bin/bash  date | tee /tmp/f 

launchd supports directing stdout file:

<key>standardoutpath</key> <string>/users/me/programming/output.txt</string> 

Comments