[Scons-users] Use raw substitution with Actions

Dirk Bächle tshortik at gmx.de
Thu Dec 3 15:06:34 EST 2015

Hi Stefan,

On 25.11.2015 13:29, Stefan Ross wrote:
> Hi,
> I want to build an Action using raw variable substitution, i.e. my action looks a bit like this:
> e['something'] = 'a        b      c'
> e.Command('target', 'source', Action('echo $something > $TARGET'))
> This doesn't work because the internal whitespace in $something is removed (and I need it).  I see the documentation for subst
> allows for a raw mode (which works), but since I'm not using subst directly, is there any way to construct the Action I want here?

in the current source code, I don't see a way to do what you want. You can only trigger the RAW mode by calling env.subst() with the 
mode as argument. But the "subst" call itself will never switch to it, based on special bracketing or similar.

However, your description sounds very much like it's a sort of XY problem. So, if you're still interested in a solution, maybe you 
can tell us a little more about the background of your question and what it is that you're actually trying to accomplish.

Best regards,


More information about the Scons-users mailing list