M
Mav
Hi, all
I need to write a perl script that execute (using system) command
to do build.
While it is doing the build, I would like to print out the item is
build on the screen,
the orginal build output will go to the a log file (build.log).
@args = ("\"$devPath\\devenv.com\" Solution\\my.sln /build Release");
open (OLDSTDOUT, ">&STDOUT") or die "Couldn't dup STDOUT: $!";
open(STDOUT, "> build.log") || die "Can't redirect stdout";
#once this execute it starts writing to build.log
$buildResult = system(@args);
#The following write to build.log
#--Build Item A
#compiling a1.cpp
#compiling a2.cpp
....
#--Build Item B
#compiling b1.cpp
#compiling b2.cpp
....
At the same time, how do I only print the following on the screen?
#To screen
Build Item A
Build Item B
Do I need to start a another process in order to do it?
How do I filter the STDOUT(to file) at the same time output to screen?
Thanks,
Mav
I need to write a perl script that execute (using system) command
to do build.
While it is doing the build, I would like to print out the item is
build on the screen,
the orginal build output will go to the a log file (build.log).
@args = ("\"$devPath\\devenv.com\" Solution\\my.sln /build Release");
open (OLDSTDOUT, ">&STDOUT") or die "Couldn't dup STDOUT: $!";
open(STDOUT, "> build.log") || die "Can't redirect stdout";
#once this execute it starts writing to build.log
$buildResult = system(@args);
#The following write to build.log
#--Build Item A
#compiling a1.cpp
#compiling a2.cpp
....
#--Build Item B
#compiling b1.cpp
#compiling b2.cpp
....
At the same time, how do I only print the following on the screen?
#To screen
Build Item A
Build Item B
Do I need to start a another process in order to do it?
How do I filter the STDOUT(to file) at the same time output to screen?
Thanks,
Mav