Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Environment variables set up with <a href="http://reference.wolfram.com/mathematica/ref/Run.html" rel="nofollow noreferrer">Run</a> or <a href="http://reference.wolfram.com/mathematica/ref/RunThrough.html" rel="nofollow noreferrer">RunThrough</a> will not affect the <em>Mathematica</em> kernel itself but will only be visible to processes launched within the same <code>Run</code> or <code>RunThrough</code> command.</p> <p>If the environment variable should be visible to the <em>Mathematica</em> kernel process, the gdb based hack described in the accepted answer to <a href="https://stackoverflow.com/questions/205064/is-there-a-way-to-change-another-processs-environment-variables">Is there a way to change another process&#39;s environment variables?</a> can be used under Mac OS X:</p> <pre><code>SetEnvironment[var_String, value_String] := Module[{valueEscaped, cmd}, valueEscaped = StringTake[ToString[CForm[value]], {2, -2}]; cmd = "call (int) putenv (\"" &lt;&gt; var &lt;&gt; "=" &lt;&gt; valueEscaped &lt;&gt; "\")"; Put[OutputForm[cmd], "!gdb -n \"" &lt;&gt; First[$CommandLine] &lt;&gt; "\" " &lt;&gt; ToString[$ProcessID ]] ] </code></pre> <p>The <em>Mathematica</em> <a href="http://reference.wolfram.com/mathematica/ref/Put.html" rel="nofollow noreferrer">Put</a> command is used to launch gdb and have it attach itself to the <em>Mathematica</em> kernel process. The gdb command <code>call (int) putenv ("var=value")</code> is then sent to gdb on stdin to set up the environment variable with <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/putenv.3.html" rel="nofollow noreferrer">putenv</a>.</p> <p>Caveat: Under Mac OS X gdb is only available if the <a href="http://developer.apple.com/xcode/" rel="nofollow noreferrer">Xcode developer tools</a> are installed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload