procmail
[Top] [All Lists]

Re: Bad substitution -- passing environment variables to bash

2002-04-22 07:38:42
Robert Brown, after getting a "bad substitution" error from this,

| :0hw
| NEWHEAD=|formail -a Message-ID: -a "Folder: "${RESENDMAIL_O#$HOME/}

surmised,

| I think procmail is trying to substitute the environment variable _before_
| the shell is executed.

No, procmail is trying to substitute the variable and execute the entire
command _without_ invoking a shell, because the command has no characters
from $SHELLMETAS (unless you've changed the content of $SHELLMETAS).

To force a shell in cases like these, the usual trick is to append a
semicolon:

  formail -a Message-ID: -a "Folder: "${RESENDMAIL_O#$HOME/} ;

Then there's the question of why you're putting the variable outside the soft
quotes rather than inside them.





_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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