procmail
[Top] [All Lists]

Re: "wc" in pipe not working!

1997-01-15 11:56:50
I need a little help here...

This works FINE in the shell, however in a procmail script, it doesn't... 
Why?  Anone have a clue?

The buggy line is the "wc" one, where it SHOULD return a line count...  In
the shell it does OK...  In the .rc file, it doesn't...  It returns a NULL
string.

BTW, names of the server and list have been altered here, since the list is
PRIVATE.

:0 c
* ^Subject:.*Welcome to the chat list
* ^From:(_dot_)*Request(_at_)xxx(_dot_)Com
| (   echo "Errors-To: Doctor(_at_)Netcom(_dot_)Com" ; \
      echo "Reply-To: Chat(_at_)xxx(_dot_)Com" ; \
      echo "X-Loop: Doctor(_at_)Netcom(_dot_)Com" ; \
      echo "X-List: Chat (Announcement)" ; \
      echo "To: Multiple Recipients of Chat List <Chat(_at_)xxxCom>" ; \
      echo "Subject: [Chat] Please welcome $TO2 to the list!" ; \
      echo "From: MReply List Server <Chat(_at_)xxx(_dot_)Com>" ; \
      echo "X-Commands-To: Request(_at_)xxx(_dot_)Com - commands in body" ; \
      echo "" ; \
      echo "Please welcome" ; \
      echo "$TO2" ; \
      echo "as a new member to our list!" ; \
      echo "" ; \
      /usr/bin/echo -n "There is a total of:" ; \
  ( /usr/ucb/wc -l ~/sr/sr-chat | cut -c1-8 ) ; \
                         ^^^^^^^^^^^^

You can't use the '~' convention in filenames with PROCMAIL, you must
specify the absolute path (e.g., if it's your $HOME directory, then
something like this should work [provided you have defined $HOME]):

        ( /usr/ucb/wc -l $HOME/sr/sr-chat | cut -c1-8 ) ; \


      echo "current subscribers now on our list!" ; \
      ) \
      | msend -q $HOME/lists/chat

The ">>>"'d line is the buggy one, which DOES appear w/o the ">>>" in the
.rc file.

Like I said, it works FINE in the shell as-is (no ()'s though...addded those
last JIC, but it didn't alter it at all).

Lates!
---------------------------------------------------------------------------
Tim <bodysurf(_at_)pobox(_dot_)com>                          
mailto:bodysurf(_at_)pobox(_dot_)com
Finger bodysurf(_at_)pobox(_dot_)com for my PGP public key (Bits 1024/KeyID 
09DA5C49).
PGP Key FPrint (09/03/94): 4C 97 F1 FA 70 55 68 91  49 D1 AD F2 DD 63 0C 15
---------------------> Please PGP encrypt your email <---------------------

<Prev in Thread] Current Thread [Next in Thread>