Re: proper way to assign return value to a variable

Michelle Konzack <[email protected]>
Newsgroups gmane.mail.procmail
Organization Tamay Dogan Network
Message-ID <20101231005601.GF25187@michelle1>
Hello Richard Reina,

:0 w # send to test_subject.pl check for order no.
* ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; test_subject($ENV{SUBJECT};'

It look weird, because if you only want the returncode you can do:

    PO=`/usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; test_subject($ENV{SUBJECT};' >/dev/null 2>&1 ; echo $?`

    :0:
    * PO ?? 0  # if PO equals zero. PO is NOT valid
    | ( formail -r \
                -I "From: Responses will be automatically discarded <[email protected]>"; \
        echo "Your mail has been administratively rejected."; \
        echo "PO is not valid." \
      ) | /usr/sbin/ssmtp -oi -t

    :0
    {# else PO is valid strip the attachments and file it
    | ( ripmime -i -d /home/richard/.pmdir/attachments/  )
    | /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; rename_attachments($ENV{PO});'

Are you sure, this is working?

> Richard

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems@tdnet France EURL       itsystems@tdnet UG (limited liability)
Owner Michelle Konzack            Owner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz                 Kinzigstraße 17
67100 Strasbourg/France           77694 Kehl/Germany
Tel: +33-6-61925193 mobil         Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

<http://www.itsystems.tamay-dogan.net/>  <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/>         <http://www.can4linux.org/>

Jabber [email protected]
ICQ    #328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.