Is it possible to obtain the build variant in the Jamroot and pass it to a script invoked with the SHELL rule?

If so, how can I pass it to the SHELL rule?

local result = [ SHELL "script.sh" : "$(variant)" ] ;

The above doesn't seem to work (the second argument to the rule doesn't seem to be passed to the script, regardless of what I put there)