Commit 6f773c65 authored by Leigh B Stoller's avatar Leigh B Stoller

Add ExecQuiet() function (stolen from libinstall) to run a command,

capturing and returning all output. Convenient.
parent d191c7b4
......@@ -479,5 +479,24 @@ sub VersionInfo($)
return $value;
}
#
# Run a command, being sure to capture all output.
#
sub ExecQuiet($)
{
#
# Use a pipe read, so that we save away the output
#
my ($command) = @_;
my $output = "";
open(PIPE,"$command 2>&1 |") or return -1;
while (<PIPE>) {
$output .= $_;
}
close(PIPE);
return $output;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment