The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-16-2008
mmesford mmesford is offline
Registered User
  
 

Join Date: Sep 2008
Location: Seattle
Posts: 4
Thanks Zaxxon,

I had tried variations of that. I don't really have anything to post because I was stuck at the beginning. Turns out the problem is with my understanding of procmail since your code works fine if I pipe to my script from another script. Here's the procmailrc if anyone has any knowlege of this stuff:

:0 b
|$HOME/test.sh

My understanding is that this should pipe the body of the email to the script test.sh. As it stands right now, the script is triggered but there doesn't appear to be anything piped. I've used your suggestion in a script named "test.sh":

while read LINE; do
echo ${LINE} > t.log
done

exit 0

if I write a small script that says:

echo "test"

save it as t.sh and run it at the command line like this:

./t.sh|./test.sh

then the file t.log is created and contains the line:

test

If I send an email to this mailbox the script test.sh is triggered but the file t.log contains only a blank line. That's where I'm at and I realize this isn't a procmail forum, but any help will be appreciated.