I have a c# application currently running from the Terminal. It opens up a new terminal to execute a certain command then closes that terminal. I'm wondering if I can just execute this command in the terminal that is currently opened, instead of opening a new one. My code to execute the command is as follows.
Process proc = new System.Diagnostics.Process();
proc.StartInfo.WorkingDirectory = @"MyDirectory";
proc.StartInfo.FileName = @"/usr/bash";
proc.StartInfo.Arguments = command;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
How would I rewrite this without opening a new terminal?