I need to create shell script (check system ) to display the output to the console and write these output to a log file at the same time.
My shell script is like that
Main() {
....
....
}
Main
It takes about 30s to display all the output to the console.
Then I put this command to the last line of the script to capture log
Main >> sys_check.log
The problem is : after the output is displayed to the console, the script takes another 30s to write the output to the log file ( so I have to wait 30s to get back to shell )
Is there any solutions to do all these works in only 30s