[Mono-bugs] [Bug 682859] System.Diagnostics.ProcessStartInfo environment variable sticky between process invocations

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Mar 27 12:30:01 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=682859

https://bugzilla.novell.com/show_bug.cgi?id=682859#c1


Gonzalo Paniagua Javier <gonzalo at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |gonzalo at novell.com
         Resolution|                            |INVALID

--- Comment #1 from Gonzalo Paniagua Javier <gonzalo at novell.com> 2011-03-27 16:30:00 UTC ---
This is the test program I used:
--------------------
using System;
using System.Diagnostics;

class Test {
    static void Main ()
    {
        ProcessStartInfo startInfo = new ProcessStartInfo ("/tmp/print.sh");
        startInfo.UseShellExecute = false;
        startInfo.EnvironmentVariables ["TEST"] = "This is test 1";
        startInfo.EnvironmentVariables ["DISPLAY"] = ":1";
        Process.Start (startInfo);
        ProcessStartInfo startInfo2 = new ProcessStartInfo ("/tmp/print.sh");
        startInfo2.UseShellExecute = false;
        startInfo2.EnvironmentVariables ["TEST"] = "This is test 2";
        startInfo2.EnvironmentVariables ["DISPLAY"] = ":2";
        Process.Start (startInfo2);
    }
}
----------------------

And this is print.sh:
-----------------
#!/bin/bash

echo "$TEST"
echo "$DISPLAY"
------------------

The output displayed is:
----------------
This is test 1
:1
This is test 2
:2
-----------------

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list