Hi Gene!
I'd like to run this shell script. In linux command line works fine.
free | awk '{ print $1,$2 }' | grep Mem: | cut -d' ' -f2
It is give me back the total memory size.
I try run in HG. But I just can run from bash file.
Bash file (totalmem.sh) contain:
free | awk '{ print $1,$2 }' | grep Mem: | cut -d' ' -f2
The c# program code:
var proc = new System.Diagnostics.Process {
StartInfo = new System.Diagnostics.ProcessStartInfo {
FileName = "bash",
Arguments = "/usr/local/bin/homegenie/totalmem.sh",
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
proc.Start();
while (!proc.StandardOutput.EndOfStream) {
string line = proc.StandardOutput.ReadLine();
//
Program.Notify("Total Memory", line);
Pause(1);
}
It's works. HG is show memory size in notify. But I'd like to run this command (free | awk '{ print $1,$2 }' | grep Mem: | cut -d' ' -f2) directy from C# code without bash file (totalmem.sh)
Is that possible?