Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.