Can someone help me with this issue?
Yes, you can set variables that will be passed as the environment to the process that executes the script. If you look at the inventory tab of the Script resource, you'll see this comment for "Environment Variables":
"the environment variables that will be passed to the script; each variable must be on a new line and have the syntax name=value; the variable's value can contain properties with the syntax %propertyName%; the script plugin will interpolate these with the current values of the corresponding properties from the script's parent JBossAS server's connection properties"
So, let's say I set the "Environment Variables" value to:
And my script contents are as follows:
Then the output of the operation will be something like the following:
This example is for Windows obviously, but the same principles apply equal well to Linux-based scripts.