Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- udevadm info --query=all --name=/dev/sda | grep ID_SERIAL
- public static string Bash(this string cmd)
- {
- var escapedArgs = cmd.Replace(""", "\"");
- var process = new Process()
- {
- StartInfo = new ProcessStartInfo
- {
- FileName = "/bin/bash",
- Arguments = $"-c "{escapedArgs}"",
- RedirectStandardOutput = true,
- UseShellExecute = false,
- CreateNoWindow = true,
- }
- };
- process.Start();
- string result = process.StandardOutput.ReadToEnd();
- process.WaitForExit();
- return result;
- }
- var output = "udevadm info --query=all --name=/dev/sda | grep ID_SERIAL".Bash();
Add Comment
Please, Sign In to add comment