0

I have created simple script which is available inside shell but not outside shell. is it possible to get enviroment outside shell

#!/bin/csh -f
# Added to avoid load of .cshrc.${USER}
module unload m(package name) 
module load m/default
which Milky
Cœur
  • 37,241
  • 25
  • 195
  • 267
user765443
  • 1,856
  • 7
  • 31
  • 56
  • related: (similar issue but for `bash`) [Calling the “source” command from subprocess.Popen](http://stackoverflow.com/q/7040592/4279) – jfs Nov 02 '15 at 12:27
  • I am able to execute script. So package available inside process and not available outside process – user765443 Nov 02 '15 at 12:29
  • [You can't update the parent's process environment directly](http://stackoverflow.com/q/496702/4279). Read [my answer and see how `env -0` and `os.environ` can be used together to update parent's environment](http://stackoverflow.com/a/22086176/4279) – jfs Nov 02 '15 at 12:34
  • I have gone through thread but could not understand env-0 concept. How is work @J.F. Sebastian – user765443 Nov 02 '15 at 12:49
  • [`env -0`](http://man7.org/linux/man-pages/man1/env.1.html) is a command that prints the current environment ending each output line with NUL (zero byte) instead of the newline (to allow literal newlines in the values). – jfs Nov 02 '15 at 12:53
  • But in this case, it's accessing env variable. But I am trying to load this want to available in another section of Program as command line. if I am load and call function which will be access Milky as a command – user765443 Nov 02 '15 at 13:00
  • Possible duplicate of [csh script as executable does not setenv](http://stackoverflow.com/questions/28738107/csh-script-as-executable-does-not-setenv) – Martin Tournoij Nov 02 '15 at 13:58
  • But it's does not contain solution – user765443 Nov 02 '15 at 14:03

0 Answers0