The Crystal Programming Language Forum

Question about

Hello, I have a question about a special case.
I need to run configure command for a source (gcc), but I need to prefix this with mlist=m64,m32,mx32. Is it possible to do that with ?

For example if I will do this, it will work ?"mlist=m64,m32,mx32", args: ["./configure", ....options ...etc])

Pass the variables defined before calling the command as env vars."./configure", args: [options...],
            env: {"mlist" => "m64,m32,mx32"})
1 Like

Is it mandatory to use env like this, or can I just put a string as argument, like :"./configure", args: [options...],
            env: ["mlist=m64,m32,mx32"])

env is of type Env which is defined here as:

alias Env = Nil | Hash(String, Nil) | Hash(String, String?) | Hash(String, String)

So no, you cannot pass an array of Strings.

Oh okay … Thanks you

Found that you can pass shell: true and pass all the things as single string."mlist=m64,m32,mx32 ./configure ....options ...etc", shell: true)

Oh nice, thanks you !