Closed gdetrez closed 11 years ago
I think export is a shell built in. this issue is documented on the run function, or do you find the documentation confusing? cmd is just a nicer api that uses run.
There is a way to set env variables in the command that you run though, at least with escaping set to False using the prefix env variable form
VAR=val command
I think export is a shell built in. this issue is documented on the run function, or do you find the documentation confusing? cmd is just a nicer api that uses run.
I see it now. I did't look at run, sorry :-/
There is a way to set env variables in the command that you run though, at least with escaping set to False using the prefix env variable form
I guess this wouldn't solve my problem anyway because the environment variable seem ta be set correctly already.
Thanks for your answer
In case someone else have the same problem, I found an easy workaround: instead of calling cmd "bnfc"
, I used cmd "env" "bnfc"
. It works fine with shelly's appendToPath
method!
that works because env is now launching a new command znc the PATH was already set for the environment that env is in.. sh -c
would probably work also. But the upcoming 1.0 version will work unless escaping False
is set. I could use env for escaping False
but it won't work on Windows, so I think I will just document the env trick
I gathered from the future plans that there is a problem with the way $PATH is handled. I'd like to know if the problem only concerns shelly
which
implementation or ifappendToPath
should be avoided completely?I tried the following code:
and the result is puzzling me:
Shelly.which
returnsNothing
(which, if I understood correctly is expected) but although the path incmd "env"
is corect andcmd "which" "bnfc"
print the expected result,cmd "bnfc"
still returns exit status 127 (command does not exists)Is there a workaround for this? I tried
cmd "export" ...
but then it can't find theexport
command.