procmail
[Top] [All Lists]

Re: More simple syntax questions

1996-01-29 14:13:27
 
Hello mighty procmail masters,


1) What is a simple way to use $? to set a variable if it is not already 
defined?

  I am not sure.  But this is what I would do:

  :0
  * ! foo ?? .
  { foo=whatever }
 
Also, what is the syntax for a condition?
 
  Owwwww.  Two birds with one stone!
 



2) Is there an cleaner way of doing OR?

  # Do something if file.1 OR file.2 doesn't exist
  :0i
  * ? test -f file.1
  * ? test -f file.2
  {
  }

well 
:0i
* ? test -f file.1 -o -f file.2
...

the first first start.  In general, if it is regex then you have |.  If
it is other things then you probably have to deal with it in a sort of
non-general way...

Soren