I'm new to Linux Bash script and learning. I'm just wondering is it possible to redirect stderr to a file only if the stderr contains ERROR.
I am executing Hadoop Hive commands, which I put it in a Bash script file to schedule the process. The hive command generates a lot of logs, and I don't want to redirect the logs to a file every time, But if the log contains Errors, then I want to redirect the log to a file and want to mail the error file to someone.
Please let me know how to achieve this. Thanks in advance..
Regards, Jeeva