I have following main.cpp
#include <iostream>
int main()
{
std::cout << "Hello Geek\n";
return 0;
}
I wrote some script to compile and run it
g++ -o test -g main.cpp
{ time ./test ; } 2>&1> /home/kj/bashTest/log
in the log I can see "Hello Geek" but the time output is displayed on console instead of log file. I am not sure how to fix it even though there is some similar post regarding this. Can anyone kindly provide me some advice?
> /home/kj/bashTest/log 2>&1