procmail
[Top] [All Lists]

How to compare variables

2010-03-07 10:31:17
Hi All,

 

I've a small question about the comparison of two variables.

 

Here is a sample:

 

FROM_=`formail -c -x"From " | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g' |
awk '{ print $1 }'`

FROM2_=`formail -c -x"From: " | expand | sed -e 's/^.*<//g' -e 's/>.*$//g' |
awk '{ print $1 }'`

FROM_SENDER_=`formail -c -x"Sender: " | expand | sed -e 's/^.*<//g' -e
's/>.*$//g' | awk '{ print $1 }'`

RETURN_PATH=`formail -c -x"Return-Path: " | expand | sed -e 's/^.*<//g' -e
's/>.*$//g' | awk '{ print $1 }'`

 

I would like to compare the 4 variables to see if the email of the sender is
coherent.

 

Can I do something like that

 

:0

  * $ FROM2_ ?? ${FROM_SENDER_}

  {

    FROM_="${FROM2_}"

  }

 

I would like to compare $FROM2_ and $FROM_SENDER_ and affect $FROM2_ to
FROM_ if the comparison is OK.

 

Is that correct? If not, could you help to build this test.

 

Franck
-------------------------------------------
E:  <mailto:mahe(_at_)civis(_dot_)net> mahe(_at_)civis(_dot_)net

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
<Prev in Thread] Current Thread [Next in Thread>
  • How to compare variables, Franck MAHE <=