dotnet new console -n microsoft.botsay -f net8.
using System.Diagnostics;
Console.WriteLine("Executing shell command: "+String.Join(" ", args));
Process process = new Process();
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
processStartInfo.FileName = @"/bin/bash";
processStartInfo.Arguments = "-c \""+String.Join(" ", args)+"\"";
processStartInfo.RedirectStandardOutput = true;
processStartInfo.RedirectStandardError = true;
processStartInfo.UseShellExecute = false;
process.StartInfo = processStartInfo;
process.Start();
Console.WriteLine("\nOutput");
Console.WriteLine(process.StandardOutput.ReadToEnd());
string error = process.StandardError.ReadToEnd();
if(error!=null && error!=""){
Console.WriteLine("\nError");
Console.WriteLine(process.StandardError.ReadToEnd());
}
dotnet run date
dotnet run ls -la