We help IT Professionals succeed at work.
Get Started

Script with or and "And" not working

LindaC
LindaC asked
on
479 Views
Last Modified: 2013-12-27
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" mail@mail.com
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE