Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
: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?

share|improve this question
up vote 3 down vote accepted

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"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.