-
Disable echo in Perl
I want do make a perl script that runs other scripts that compile parts of a project. And if i run with system another script it displayes the whole commands set that the script executes. I want to disable that echo (inhibate it or something like that) so only my script can display messages on the stdin.
Thank you!
-
-
Generally, you redirect the output of "other commands" to /dev/null or NUL: [linux/windows respectively], or if you still want to save the output, redirect to a file. If you want to, you can also redirect stderr by "2>" or "2>&1" - the latter "combines" the stderr with stdout.
--
Mats
-
Code:
...
my $status = system("generate2.bat");
if (($status >>=8) != 0)
{
die "Failed to generate pp1.txt";
}
...
this displays what the generate2.bat echoes. I don't want to see that. How can I stop it from printing? (I'm not allowed to modify the generate2.bat file)
-
As described above:
Code:
system("generate2.bat >> NUL:");
--
Mats
-
now it gives me
Code:
sh: generate2.bat: command not found