} else {
$cmdtxt = "# $cmdstr\n";
}
- print $cmdtxt;
- STDOUT->flush();
+
+ if ($opt_testmode) {
+ print $cmdtxt;
+ STDOUT->flush();
+ }
+
print $logfd $cmdtxt;
my $reader = IO::File->new();
my $ec = ($? >> 8);
if ($ec) {
- die "command '$cmd' failed with exit code $ec";
+ die "command '$cmdstr' failed with exit code $ec";
}
return $ostream;