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 wrote: > >> "Graham Fawcett" wrote in message >> news:j62ido$1n0s$1...@digitalmars.com... >>> On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky wrote: >>> Due to process

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 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"); assert(environment["SOME_

Re: "Sourcing" a script's env into D?

2011-09-29 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

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 wrote: "Graham Fawcett" 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 SOME_VAR=foobar test.d

Re: "Sourcing" a script's env into D?

2011-09-29 Thread Nick Sabalausky
"Graham Fawcett" 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 >> SOME_VAR=foobar >> >> test.d: >> import std.process; >> void main() >>

Re: "Sourcing" a script's env into D?

2011-09-29 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.v2k6axvveav7ka@localhost.localdomain... > 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; >>

Re: "Sourcing" a script's env into D?

2011-09-29 Thread Steven Schveighoffer
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, is bec

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"); > } >

"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). T