Re: Sourcing a script's env into D?

2011-09-30 Thread Jacob Carlborg
On 2011-09-29 19:31, Nick Sabalausky wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import std.process; void main() { system(./script.sh); assert(environment[SOME_VAR] == foobar); } This, of course, is because the script is

Re: Sourcing a script's env into D?

2011-09-30 Thread Regan Heath
On Fri, 30 Sep 2011 07:18:34 +0100, Jacob Carlborg d...@me.com wrote: On 2011-09-29 19:31, Nick Sabalausky wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import std.process; void main() { system(./script.sh);

Re: Sourcing a script's env into D?

2011-09-30 Thread Graham Fawcett
On Thu, 29 Sep 2011 17:20:44 -0400, Steven Schveighoffer wrote: On Thu, 29 Sep 2011 17:02:28 -0400, Nick Sabalausky a@a.a wrote: Graham Fawcett fawc...@uwindsor.ca wrote in message news:j62ido$1n0s$1...@digitalmars.com... On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky wrote: Due to

Sourcing a script's env into D?

2011-09-29 Thread Nick Sabalausky
Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import std.process; void main() { system(./script.sh); assert(environment[SOME_VAR] == foobar); } This, of course, is because the script is run in a totally separate process (AIUI). The

Re: Sourcing a script's env into D?

2011-09-29 Thread Graham Fawcett
On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import std.process; void main() { system(./script.sh); assert(environment[SOME_VAR] == foobar); } This, of course,

Re: Sourcing a script's env into D?

2011-09-29 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.v2k6axvveav7ka@localhost.localdomain... On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky a@a.a wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import

Re: Sourcing a script's env into D?

2011-09-29 Thread Steven Schveighoffer
On Thu, 29 Sep 2011 17:02:28 -0400, Nick Sabalausky a@a.a wrote: Graham Fawcett fawc...@uwindsor.ca wrote in message news:j62ido$1n0s$1...@digitalmars.com... On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh