procmail
[Top] [All Lists]

Re: Avoiding flag c cloning penalty. An more efficient way?

1998-08-24 14:14:37
Jari Aalto asked,

|     Now, I run shell commands that need not to be serialized,
|     so instead of doing the std way:
| 
|         :0 hic
|         | command
| 
|     I can avoid the extra fork altogether by using
| 
|         :0
|         * ? command
|         { }
| 
|     But would it also be same as
| 
|         dummy = `command`
| 
|     Any diffrence between 2 and 3 or other remarks?

My guess, not knowing how to read the source, is that #2 would be better, as
(a) you can limit the input to the command when it doesn't need to read all
[or maybe any] of the message text by using "variable ??", (b) it would not
clog the environment with an extra variable, (c) you can put other conditions
ahead of it and run the command only when needed [you'd need to add a brace
structure around the assignment to do that with #3], and (d) you can put
actions or assignments inside the braces [and negate the condition if need
be] to make decisions based on the outcome of the command.

Granted, I don't know how important (b) is; it may be of no consequence
whatever.

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