Hi Experts,
I want to check in table that if third column value is "bhu" & if it is greater than 500 it will send mail
other wise there will be no mail. but as per my script mails are still coming even value is below 500 with one blank mail(without any content) with subject line"test mail".
I want that if value is below 500 there will be no mail, if value is above or equal to 500 there will be mail only.
Both your spec and your code snippet are a bit hard to follow.
Looks like you are assigning an empty string to var if $10 is below 500, and then sending that empty value by mail.
In order to send mail only if your conditions are true, try
Hi Rudic, Thanks for your reply, I have tried your suggestion but it is not working.
Below one I have tried .
Actually I want to send mail if $10 is equal or above than 500 then mail will be $3" is running in "$1" from last "$10" secs" and if it is below 500 there will be no mail.
Just could you please also describe this command also , that what will be the mail content.
You can't chop the compound command in the middle of the line; FS="," sets the field separator for awk and needs to follow the awk immediately, as does the rest.
The mail content will be TMP's content, which is awk's output.
Last edited by RudiC; 05-03-2015 at 03:13 AM..
Reason: FS was set to ",", not ";"
Hi Rudic,
as per my last post just I want to add that I have checked again with your command
it is continuously running only, after several time I have just forcely stopped with ctrl+D .but it is not giving any output. Kindly suggest.
Please help.
Thanks & Regards
Kumar
Last edited by dravi_laxmi; 04-30-2015 at 02:41 PM..
Thanks Sir, It is my mistake, It is working now.
Just one more doubt , I have just tried the another option with above script like if $10=0 then mail should come, after running this script mails are coming but there is no content in the mail, only subject line is there (test mail).
Could you please give some your valuable suggestion for this.
Thanks & Regards,
Kumar
---------- Post updated at 01:49 PM ---------- Previous update was at 01:19 PM ----------
Rudic Sir, just my last updated post that $10==0 is not working, is the reason like there are many rows in table in which $10 is 0 , so is it like that it will not work if condition is fulfill for more than one rows. actually mails are coming without any content but with subject line"test mail"
ENVIROMENT
Linux: RHEL 6.4
Log Path: /usr/iplanet/servers/https-company/logs
Log Format: user.log.03-15-2015
I have log4j log rotation enabled rotating files on a daily basis.
The rotated logs are NOT compressed & are taking up too much space.
I need a script that will run daily that... (1 Reply)
I am using an awk command to extract a particular portion of a string. Below is the command and its output on a Linux system:
oracle@host1:/tmp (/home/oracle)
$uname -a
Linux host1 2.6.32-279.39.1.el6.x86_64 #1 SMP Fri Nov 15 05:38:26 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
... (7 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Can you explain what this line of script is doing.
What I have understood is :
-- variable C is the name of a software which is either not installed, so it must be installed or allready installed and then should be update if newer version found
-- branch B="$B $C" is to install the software
--... (4 Replies)
I am parsing file for the fields using awk command, first i check 26th field for two characters using substr function if it matches then using for loop on array i search 184th field for 4 chars if it matches then i print the required fields but on execution i get the error, please help...... (5 Replies)
Hi,
I have to change the mail server, but I could not find the file where it is written in.
I use the following command:
</> echo krneki | mail -v -s "New report" receiver@our.comp
Server name ("skala") can be seen in a terminal output ....
receiver@our.comp ... Connecting to... (0 Replies)
Hi ,
I am new to unix , i am using the mail and mailx command to send the mail .How come i will know the my mail command using which server as mail box..
Please help me ..
Thanks in advance (1 Reply)
Hi friends,
I have a script that sets the env variable path based on different conditions.
Now the new path variable setting should not done in the same terminal or same shell.
Only a new terminal or new shell should have the new path env variable set.
I am able to do this only as follows:
>cd... (1 Reply)