procmail recipe question

Posted on 2006-05-22
Last Modified: 2010-05-18

I run this from bash:
expr $(cat /home/bryantest/count) + 1 > /home/bryantest/count

Does anyone know how to put it in a procmail recipe?  I just want to use the normal autoresponse, which I have pasted below this at the end.  Can anyone show me how to include it?

What it does is to create a counter for every time the procmail script is run.  Also, if there is a much easier way to do it I will be happy to use the better way instead.

Here is the current script from the man pages of procmailex.
              SHELL=/bin/sh    # for other shells, this might need adjustment

              :0 Whc: vacation.lock
               # Perform a quick check to see if the mail was addressed to us
              * $^To:.*\<$\LOGNAME\>
               # Don't reply to daemons and mailinglists
              * !^FROM_DAEMON
               # Mail loops are evil
              * !^X-Loop: your@own.mail.address
              | formail -rD 8192 vacation.cache

                :0 ehc         # if the name was not in the cache
                | (formail -rI"Precedence: junk" \
                     -A"X-Loop: your@own.mail.address" ; \
                   echo "I received your mail,"; \
                   echo "but I won't be back until Monday."; \
                   echo "-- "; cat $HOME/.signature \
                  ) | $SENDMAIL -oi -t
Question by:bryanlloydharris
    LVL 51

    Accepted Solution

    > Does anyone know how to put it in a procmail recipe?
    write is as follows in your .procmailrc (wherever you need it):
    expr "`cat /home/bryantest/count`" '+' 1 > /home/bryantest/count
    LVL 3

    Author Comment

    Thank you ahoffmann (-:
    It worked very well

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now