1

Maybe stupid question, but I can't find it anywhere. I have a variable in procmail (eg $SUBJECT) and I need to push it to some shell command. Something like:

# in /etc/procmailrc
SUBJECT="^(XX-)?Subject: ?"

# in user defined procmailrc file
FORMAIL=/usr/bin/formail
:0 fhw
| ${FORMAIL} -A 'X-Subject-Is: $SUBJECT'

But it save me a header X-Subject-Is: $SUBJECT, not with Subject line.. Is there any way, how to push variable to shell command?

stderr
  • 871
  • 6
  • 15

1 Answers1

3

The command is subject to the regular shell variable replacement rules, so just try replacing the single quotes with double quotes.

| ${FORMAIL} -A "X-Subject-Is: $SUBJECT"
chutz
  • 7,569
  • 1
  • 28
  • 57