-->

open -a TextEdit $1
var scriptPath = 「用意したopen_text_edit.shのパス」;
var argument = 「開きたいテキストファイルのパス」;
ProcessStartInfo pInfo = new ProcessStartInfo();
pInfo.FileName = "/bin/bash";
pInfo.Arguments = $"{scriptPath} {argument}";
pInfo.ErrorDialog = true;
pInfo.UseShellExecute = true;
Process.Start(pInfo);

Process[] ps = Process.GetProcessesByName("textedit");
foreach (Process p in ps)
{
p.CloseMainWindow();
p.Close();
}