Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# interoperability with linux or bash script

using System;
using System.Diagnostics;

namespace runGnomeTerminal
{
    class MainClass
    {
        public static void ExecuteCommand(string command)
        {
            Process proc = new System.Diagnostics.Process ();
            proc.StartInfo.FileName = "/bin/bash";
            proc.StartInfo.Arguments = "-c " " + command + " "";
            proc.StartInfo.UseShellExecute = false; 
            proc.StartInfo.RedirectStandardOutput = true;
            proc.Start ();

            while (!proc.StandardOutput.EndOfStream) {
                Console.WriteLine (proc.StandardOutput.ReadLine ());
            }
        }

        public static void Main (string[] args)
        {
            ExecuteCommand("gnome-terminal -x bash -ic 'cd $HOME; ls; bash'");
        }


    }
}
Comment

c# interoperability with linux or bash script

dotnet publish **path to your solution** --configuration Release --framework netcoreapp3.0 --output .**output path** --self-contained false --runtime linux-x64 --verbosity quiet
Comment

PREVIOUS NEXT
Code Example
Csharp :: How to do a comment in c# 
Csharp :: file.deletealltext 
Csharp :: true false when key pressed in c sharp unity 
Csharp :: c# replace characters in string that are invalid using regex 
Csharp :: c# access control from another thread 
Csharp :: Initalize C# project in VS Code 
Csharp :: how to take previous record in linq c# 
Csharp :: python mokeypatch asser called 
Csharp :: unity rotatetowards 
Csharp :: touch screen to world point 
Csharp :: nullable 
Csharp :: how to handle array getter setter in c# of string type 
Csharp :: how to download things c# 
Csharp :: how to update modal class using dbfirst in asp.net core 
Csharp :: linq get values is not in other table 
Csharp :: asp.net core reverse engineer database 
Csharp :: matric multiplication 
Csharp :: c# get executing method name 
Csharp :: c# for loop Statement 
Csharp :: hdrp lit change emmision values 
Csharp :: Show Form on Second Monitor 
Csharp :: source a listbox by property of object c# 
Csharp :: .netstandard distinctby iqueryable 
Csharp :: Set orientation of moving object towards it movement direction 
Csharp :: go down a line in function documentation 
Csharp :: Process start web document 
Csharp :: c# url relative path remove 
Csharp :: C# Read Excel columns header return to list 
Csharp :: how to set window position 
Csharp :: custom vs code snippet 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =