I am using the following method in order to pass commands into a subshell that is started by newgrp. #!/bin/cshecho Before newgrp/usr/bin/newgrp users <<EONGecho hello from within newgrpidEONGecho After newgrpIt works fine as long as I don't try and set anything in the subshell.i.e#!/bin/cshecho Before newgrp/usr/bin/newgrp users <<EONGecho hello from within newgrpset a=npyecho $aidEONGecho After newgrpAs you can see above, I set a=npy inside the subshell and doing an echo $a should return npy. However, I get to see an error as a is not declared.Can someone tell me how I can set env vars inside a subshell while using << 
setting variables inside subshell when using <
shell script;csh;here document