Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Manipulate condition to send mail based on output text in file Post 303038872 by midhun3108 on Monday 16th of September 2019 07:53:46 AM
Old 09-16-2019
Hi RudiC,
Can you please explain the above code what you replied. How does the above code fetch Return code from file and assign SUCCESS FAIL WARNING based on it ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Send text file to mail

I have a utility that opens a telnet session and allows me to execute commands through a script. The utility allows me to output to a text file whatever is outputted to screen. This utility runs from a DOS prompt in Windows 95/98, NT or 2000. How can I mail text file this to a certain user. I... (2 Replies)
Discussion started by: petrosi
2 Replies

2. UNIX for Advanced & Expert Users

How to parse through a file and based on condition form another output file

I have one file say CM.txt which contains values like below.Its just a flat file 1000,A,X 1001,B,Y 1002,B,Z ... .. total around 4 million lines of entries will be in that file. Now i need to write another file CM1.txt which should have 1000,1 1001,2 1002,3 .... ... .. Here i... (6 Replies)
Discussion started by: sivasu.india
6 Replies

3. Shell Programming and Scripting

Send a mail to IDs listed in a text file

I have a list of mail ids in text file and want a ksh script that reads this text file and sends a mail to all mail ids with same subject line and content. I am using UX-HP machine and KSH. Thanks for help in advance! (5 Replies)
Discussion started by: Sriranga
5 Replies

4. UNIX for Advanced & Expert Users

Output will send in mail

Hi All, Requirement is to select the data from database and send the output in mail. But the output should in HTML tabular format in mail body. For example my select command is : select ename,esal,edegn,dept from emp where deptno in (10,15); In the mail body the output should : Employee... (3 Replies)
Discussion started by: alex_us
3 Replies

5. UNIX for Advanced & Expert Users

send mail script only if condition is met

only wc -l greater than 0 then send email to owner, otherwise do nothing. ie. result=powermt display dev=all|awk '{print $7}'|grep -i dead|wc -l if then echo $result else : fi mailx -s "there is dead path (s)" "mymail@mydomain.com" ----------- it is not working... (2 Replies)
Discussion started by: orafup
2 Replies

6. Shell Programming and Scripting

Help with File processing - Adding predefined text to particular record based on condition

I am generating a output: Name Count_1 Count_2 abc 12 12 def 15 14 ghi 16 16 jkl 18 18 mno 7 5 I am sending the output in html email, I want to add the code: <font color="red"> NAME COLUMN record </font> for the Name... (8 Replies)
Discussion started by: karumudi7
8 Replies

7. Shell Programming and Scripting

Replace text inside XML file based on condition

Hi All, I want to change the name as SEQ_13 ie., <Property Name="Name">SEQ_13</Property> when the Stage Type is PxSequentialFile ie., <Property Name="StageType">PxSequentialFile</Property> :wall: Input.XML <Main> <Record Identifier="V0S13" Type="CustomStage" Readonly="0">... (3 Replies)
Discussion started by: kmsekhar
3 Replies

8. Shell Programming and Scripting

Send mail based on a group

Hello Gurus, I have a question. I have a file which has 2 columns and is tab separated and looks like below: FIELD1 FIELD2 Manual m456@hotmail.com Execution din098@gmail.com Artistic m456@hotmail.com Graphic din098@gmail.com FIELD2 values will have always either of the 2 above... (8 Replies)
Discussion started by: Max499
8 Replies

9. UNIX for Advanced & Expert Users

Group the records based on empno and send mail

Hi All, I have records in a file with name,SSO,openitems,manageremail with | delimited file.Now i want to group the records by SSO and openitems and send email to their manageremail. kiran|1111|draft|aaa@gmail.com guna|2222|reject|bbb@gmail.com kiran|1111|submitter|aaa@gmail.com... (2 Replies)
Discussion started by: kiranparsha
2 Replies

10. UNIX for Beginners Questions & Answers

Read a file and send mail based on grep

Hi All, I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using. So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
FAIL(9) 						   BSD Kernel Developer's Manual						   FAIL(9)

NAME
KFAIL_POINT_CODE, KFAIL_POINT_RETURN, KFAIL_POINT_RETURN_VOID, KFAIL_POINT_ERROR, KFAIL_POINT_GOTO, fail_point, DEBUG_FP -- fail points SYNOPSIS
#include <sys/fail.h> KFAIL_POINT_CODE(parent, name, code); KFAIL_POINT_RETURN(parent, name); KFAIL_POINT_RETURN_VOID(parent, name); KFAIL_POINT_ERROR(parent, name, error_var); KFAIL_POINT_GOTO(parent, name, error_var, label); DESCRIPTION
Fail points are used to add code points where errors may be injected in a user controlled fashion. Fail points provide a convenient wrapper around user-provided error injection code, providing a sysctl(9) MIB, and a parser for that MIB that describes how the error injection code should fire. The base fail point macro is KFAIL_POINT_CODE() where parent is a sysctl tree (frequently DEBUG_FP for kernel fail points, but various sub- systems may wish to provide their own fail point trees), and name is the name of the MIB in that tree, and code is the error injection code. The code argument does not require braces, but it is considered good style to use braces for any multi-line code arguments. Inside the code argument, the evaluation of RETURN_VALUE is derived from the return() value set in the sysctl MIB. See SYSCTL VARIABLES below. The remaining KFAIL_POINT_*() macros are wrappers around common error injection paths: KFAIL_POINT_RETURN(parent, name) is the equivalent of KFAIL_POINT_CODE(..., return RETURN_VALUE) KFAIL_POINT_RETURN_VOID(parent, name) is the equivalent of KFAIL_POINT_CODE(..., return) KFAIL_POINT_ERROR(parent, name, error_var) is the equivalent of KFAIL_POINT_CODE(..., error_var = RETURN_VALUE) KFAIL_POINT_GOTO(parent, name, error_var, label) is the equivalent of KFAIL_POINT_CODE(..., { error_var = RETURN_VALUE; goto label;}) SYSCTL VARIABLES
The KFAIL_POINT_*() macros add sysctl MIBs where specified. Many base kernel MIBs can be found in the debug.fail_point tree (referenced in code by DEBUG_FP). The sysctl variable may be set using the following grammar: <fail_point> :: <term> ( "->" <term> )* <term> :: ( (<float> "%") | (<integer> "*" ) )* <type> [ "(" <integer> ")" ] [ "[pid " <integer> "]" ] <float> :: <integer> [ "." <integer> ] | "." <integer> <type> :: "off" | "return" | "sleep" | "panic" | "break" | "print" The <type> argument specifies which action to take: off Take no action (does not trigger fail point code) return Trigger fail point code with specified argument sleep Sleep the specified number of milliseconds panic Panic break Break into the debugger, or trap if there is no debugger support print Print that the fail point executed The <float>% and <integer>* modifiers prior to <type> control when <type> is executed. The <float>% form (e.g. "1.2%") can be used to spec- ify a probability that <type> will execute. The <integer>* form (e.g. "5*") can be used to specify the number of times <type> should be exe- cuted before this <term> is disabled. Only the last probability and the last count are used if multiple are specified, i.e. "1.2%2%" is the same as "2%". When both a probability and a count are specified, the probability is evaluated before the count, i.e. "2%5*" means "2% of the time, but only 5 times total". The operator -> can be used to express cascading terms. If you specify <term1>-><term2>, it means that if <term1> does not 'execute', <term2> is evaluated. For the purpose of this operator, the return() and print() operators are the only types that cascade. A return() term only cascades if the code executes, and a print() term only cascades when passed a non-zero argument. A pid can optionally be specified. The fail point term is only executed when invoked by a process with a matching p_pid. EXAMPLES
sysctl debug.fail_point.foobar="2.1%return(5)" 21/1000ths of the time, execute code with RETURN_VALUE set to 5. sysctl debug.fail_point.foobar="2%return(5)->5%return(22)" 2/100ths of the time, execute code with RETURN_VALUE set to 5. If that does not happen, 5% of the time execute code with RETURN_VALUE set to 22. sysctl debug.fail_point.foobar="5*return(5)->0.1%return(22)" For 5 times, return 5. After that, 1/1000th of the time, return 22. sysctl debug.fail_point.foobar="0.1%5*return(5)" Return 5 for 1 in 1000 executions, but only 5 times total. sysctl debug.fail_point.foobar="1%*sleep(50)" 1/100th of the time, sleep 50ms. sysctl debug.fail_point.foobar="1*return(5)[pid 1234]" Return 5 once, when pid 1234 executes the fail point. AUTHORS
This manual page was written by Zach Loafman <zml@FreeBSD.org>. CAVEATS
It is easy to shoot yourself in the foot by setting fail points too aggressively or setting too many in combination. For example, forcing malloc() to fail consistently is potentially harmful to uptime. The sleep() sysctl setting may not be appropriate in all situations. Currently, fail_point_eval() does not verify whether the context is appropriate for calling msleep(). BSD
May 10, 2009 BSD
All times are GMT -4. The time now is 04:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy