I want to run some shell commands in zig which asks for input. For example look at my code, I want to update packages, but that requires sudo password which I obviously cant enter. Im also ok, to just run .sh file with zig, but I want to see progress and obviously be able to input password or smth else if needed. Is there some better way to do this?
<code>const std = @import("std");
pub fn test() !void {
const result = try std.process.Child.run(.{
.allocator = std.heap.page_allocator,
.argv = &[_][]const u8{ "sudo", "xbps-install", "-Su" },
});
}
</code>
<code>const std = @import("std");
pub fn test() !void {
const result = try std.process.Child.run(.{
.allocator = std.heap.page_allocator,
.argv = &[_][]const u8{ "sudo", "xbps-install", "-Su" },
});
}
</code>
const std = @import("std");
pub fn test() !void {
const result = try std.process.Child.run(.{
.allocator = std.heap.page_allocator,
.argv = &[_][]const u8{ "sudo", "xbps-install", "-Su" },
});
}