The mail command you are using is not standardized, but on most UNIX and UNIX-like systems, the mail utility takes one or more operands (after the options have been processed) with each operand specifying the e-mail address of someone who should receive that message. What operating system are you using?
If you want to send mail just to yourself while testing (instead of to the list of recipients specified in /home/p611568/d2e/xeenos_scripts/emailparm) and to enable us to see where my code is getting stuck in an infinite loop, change the second line of your version of my script from:
to:
and then change the line:
to the two lines:
Move a couple of *.rpt files from /home/p611568/d2e/error_directory back to /home/p611568/d2e/logs so there will be files to process before you run this script again. (I assume that these two directories are on the same filesystem so the timestamps won't change when you move them.)
Then, run the script again and show us the trace log it prints while running (in CODE tags, please) so we can verify that the recipient list is being created correctly and see where my code is going into an infinite loop.
Note that my script moved the code creating the entire mail message inside the then clause of the if statement that sends the email. the code you showed us earlier initializes the mail file contents with three lines of data before entering the for loop and then adds two more lines to that file every time a failed file is found. This is why subsequent mail messages contain more and more files at the end of the message.
This User Gave Thanks to Don Cragun For This Post:
:confused: I need to find a place or places on the Internet where I can find UNIX scripts to view and to modify to make life easy on the UNIX environment. Can someone help me on this. Thanks (7 Replies)
Hi All,
I am new to Unix Scripting. I have below scenario. I need to write a Unix function with the following.
1. I have table. From this table I need to write a query.
SELECT Col1(File_nm),Col2(From_Loc),Col3(To_Loc)
FROM A
WHERE CONDITION
For... (1 Reply)
Hello every one, plz help me out. I m using 4 files in unix, like file1, file2, file3,file4 in which primary key is ID in column(field) of 4 files.
On the bases of ID, i want the corresponding field of 4 files in final file let say collected file. In collected file, ID column should occur only one... (16 Replies)
Hi Gurus,
I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (1 Reply)
Hi Gurus,
I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (4 Replies)
how to check if a unix script gets executed without errors across all unix platforms.
incase if a script gets executed without errors only one platform say AIX, what needs to be done to that script such that it will run all unix platforms like linux, hp, sun etc (2 Replies)
i need help with this problem this is the problem: Write a script that logs how many users login on/off the system over a 5 minute period. It can run in the foreground, and run 4 times a minute. Set a trap that will not allow a CNTRL-C command, and if a CNTRL-C is excuted store the time and date... (1 Reply)
Hello Experts,
I have the following questions to be discussed here at this esteemed discussion forum.
I have two Excel sheets which contain Unix Commands llike creating directory the structure/ftp/Copy/Zip etc to basically create an environment. I need help in understanding some of... (1 Reply)