troubleshooting Question

Script with or and "And" not working

Avatar of LindaC
LindaCFlag for Puerto Rico asked on
Unix OS
11 Comments1 Solution480 ViewsLast Modified:
I have this portion of the script but is not working.  It is supposed to send an email because the log has a message that is not within this message that can be ignored:

•      EXP-00007: dictionary shows no columns for AAIS.TMP*
•      EXP-00007: dictionary shows no columns for AAIS.LIJPKGS_NOFAC
•      EXP-00007: dictionary shows no columns for AAIS.EDTTNLIJPKGS
•      EXP-00007: dictionary shows no columns for AAIS.DUP_PKGMEQ_TN1

The email must be sent if found one of this messages:

ORA-|rejected|Killed|Server out
EXP-00007 for other tables that are not one of the above

if [[ $(egrep -i -c "ORA-|rejected|Killed|Server out" "$log" -gt 0) || $(egrep -i -c "EXP-00007: dictionary shows no columns for" "$log" -eq 0) && $(egrep -i -c "AAIS.TMP|AAIS.LIJPKGS_NOFAC|AAIS.EDTTNLIJPKGS|DUP_PKGMEQ_TN1" "$log" -eq 0) ]]; then mailx -s "Full Structure export of Aais production with error $log"

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros