Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Manipulate condition to send mail based on output text in file Post 303038882 by RudiC on Monday 16th of September 2019 09:51:25 AM
Old 09-16-2019
The first grep retrieves the line "Return Code n", the second extracts the number n which becomes the result of the "command substitution" which in turn serves as an index into the RT array:
0 ->Success
2 -> Failure
 

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
lset(n) 						       Tcl Built-In Commands							   lset(n)

__________________________________________________________________________________________________________________________________________________

NAME
lset - Change an element in a list SYNOPSIS
lset varName ?index...? newValue _________________________________________________________________ DESCRIPTION
The lset command accepts a parameter, varName, which it interprets as the name of a variable containing a Tcl list. It also accepts zero or more indices into the list. The indices may be presented either consecutively on the command line, or grouped in a Tcl list and pre- sented as a single argument. Finally, it accepts a new value for an element of varName. If no indices are presented, the command takes the form: lset varName newValue or lset varName {} newValue In this case, newValue replaces the old value of the variable varName. When presented with a single index, the lset command treats the content of the varName variable as a Tcl list. It addresses the index'th element in it (0 refers to the first element of the list). When interpreting the list, lset observes the same rules concerning braces and quotes and backslashes as the Tcl command interpreter; however, variable substitution and command substitution do not occur. The command constructs a new list in which the designated element is replaced with newValue. This new list is stored in the variable varName, and is also the return value from the lset command. If index is negative or greater than or equal to the number of elements in $varName, then an error occurs. The interpretation of each simple index value is the same as for the command string index, supporting simple index arithmetic and indices | relative to the end of the list. If additional index arguments are supplied, then each argument is used in turn to address an element within a sublist designated by the previous indexing operation, allowing the script to alter elements in sublists. The command, lset a 1 2 newValue or lset a {1 2} newValue replaces element 2 of sublist 1 with newValue. The integer appearing in each index argument must be greater than or equal to zero. The integer appearing in each index argument must be strictly less than the length of the corresponding list. In other words, the lset command cannot change the size of a list. If an index is outside the permitted range, an error is reported. EXAMPLES
In each of these examples, the initial value of x is: set x [list [list a b c] [list d e f] [list g h i]] -> {a b c} {d e f} {g h i} The indicated return value also becomes the new value of x (except in the last case, which is an error which leaves the value of x unchanged.) lset x {j k l} -> j k l lset x {} {j k l} -> j k l lset x 0 j -> j {d e f} {g h i} lset x 2 j -> {a b c} {d e f} j lset x end j -> {a b c} {d e f} j lset x end-1 j -> {a b c} j {g h i} lset x 2 1 j -> {a b c} {d e f} {g j i} lset x {2 1} j -> {a b c} {d e f} {g j i} lset x {2 3} j -> list index out of range In the following examples, the initial value of x is: set x [list [list [list a b] [list c d]] [list [list e f] [list g h]]] -> {{a b} {c d}} {{e f} {g h}} The indicated return value also becomes the new value of x. lset x 1 1 0 j -> {{a b} {c d}} {{e f} {j h}} lset x {1 1 0} j -> {{a b} {c d}} {{e f} {j h}} SEE ALSO
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lsort(n), lrange(n), lreplace(n), string(n) | KEYWORDS
element, index, list, replace, set Tcl 8.4 lset(n)
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy