Thanks for all your replies. This has been a learning experience for me and I appreciate your help.
I have 2 minor changes...
The date it needs to look for has a space between the month and the day (Nov 17). Also, is there a way to have it not send the email if there are no severe errors? I know this probably can't be done in a single line, and that is OK.
I ran just this part of it: grep "$(date +"%b %d")" order.log|grep "SEVERE" and I do get output as seen below:
Nov 18 05:02:26 [SEVERE] Ord <R00055430405-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000553218-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000554462-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000553781-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000552862-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000553084-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000553640-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000550070-SFI> has status <S> and therefore can't be deleted.
Nov 18 08:47:17 [SEVERE] Ord <P00000553780-SFI> has status <S> and therefore can't be deleted.
When uuencode has two parameters, the first is the input file and that means that uuencode will not be reading from stdin thus breaking the pipeline. At the time uuencode reads from file1, the tee program may or may not have written to it. It depends on the order in which the programs in the pipeline are launched, the number of cpu's, etc.
If you really need file1 to exist on the local system try:
Would it be possible to store a list of email addresses in another file and have this code loop through this list, sending the email to every recipient in this list?
You can have more than one recipient with mailx. Just tack them on the end. Or create an alias and send the mail to the alias. Either is more efficient than looping.