Shell script failing for unknown reasons

Hi,
I'm executing a shell script on a file. My idea is to use Hazel to process a folder containing a text file and maybe a photo to create automatic journal entries with it. The script runs fine when I run it in Terminal, it doesn't execute in Hazel. I don't even get an error. I run this in /bin/sh.
The first grep command is to filter out my usual email signature. The other commands should be self explaining. What am I missing here?
Thanks,
Zettt
I'm executing a shell script on a file. My idea is to use Hazel to process a folder containing a text file and maybe a photo to create automatic journal entries with it. The script runs fine when I run it in Terminal, it doesn't execute in Hazel. I don't even get an error. I run this in /bin/sh.
- Code: Select all
journalentry=$(grep -v -e "Written with major efforts on an iPhone." -e "Written with major efforts on an iPad." "$1")
if [[ -e "$HOME/Dropbox/Apps/Attachments/photo.JPG" && -e "$1" ]]; then
echo "$journalentry" | /usr/local/bin/dayone -p="$HOME/Dropbox/Apps/Attachments/photo.JPG" new
rm "$HOME/Dropbox/Apps/Attachments/photo.JPG"
elif [[ ! -e "$HOME/Dropbox/Apps/Attachments/photo.JPG" && -e "$1"]]; then
echo "$journalentry" | /usr/local/bin/dayone new
fi
The first grep command is to filter out my usual email signature. The other commands should be self explaining. What am I missing here?
Thanks,
Zettt