Sponsored Content
Top Forums Shell Programming and Scripting creating email based on an output Post 62287 by saswerks on Monday 14th of February 2005 05:27:32 PM
Old 02-14-2005
creating email based on an output

Hello folks. I need to create a script that looks at a certain output (list of full paths of files) and gets the owner's name (2nd position in the path, for example: /dirA/jsmith/blah1/more_blah/still_blah... etc)
Gets the jsmith and greps the related file for jsmith and send that output to jsmith, and moves to the next.

Problem: The output may contain each file listing by jsmith, and I do not want jsmith to get 100 emails (even though he deserves it, LOL).

The output is basically a monitoring list that looks at users saving files where they should not, and I would like for them to get an email automatically ...

I am sure I am making this too complicated...so any idea?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating a multi-recipient email script

Well, I'm fairly new to shell scripting, so please excuse my newbieness :) I was wondering if it was possible to create a shell script that retrieves a list of recipients in a list_file and sends a message out all at once? An example of a list file would look similar to this: $ cat... (2 Replies)
Discussion started by: TheSunTheSea
2 Replies

2. Programming

Creating email account prgramatically + java ?

Dear Friend, I am working on java application which requires that after successful registration an email account is created (say username@mydomain.com) for user. Is is possible to create e-mail account programatically ? Enviornment - CentOs, Tomcat Web server. CPanel is available, but... (0 Replies)
Discussion started by: reckless_jack
0 Replies

3. Shell Programming and Scripting

Shell script to email based on flat file output

Hi All, I am a newbee in unix but still have written a shell script which should trigger a mail based on certain conditions but the problem is that my file is not being read. Below is the code please advise. I do not know where is it failing. Note $ and the no followed with it is the no of... (1 Reply)
Discussion started by: apoorva
1 Replies

4. Shell Programming and Scripting

Converting line output to column based output

Hi Guys, I am trying to convert a file which has a row based output to a column based output. My original file looks like this: 1 2 3 4 5 6 1 2 3 1 2 3 (8 Replies)
Discussion started by: npatwardhan
8 Replies

5. Shell Programming and Scripting

Creating folders based on number of files

I have hundreds of files numbered in consecutive number in one single folder What I would like to do is to make as many subfolders as needed (dependeing on the number of individual files) and name them Folder01, Folder02, etc. Then, move file01 to folder01, file02 to folder02 so on and so... (3 Replies)
Discussion started by: Xterra
3 Replies

6. Shell Programming and Scripting

creating a file name based on date

I need to automate a weekly process of piping a directory list to a csv file. Normally I do ls -l > files_04182010.csv (04182010 being the date..) Can someome show me how I would script this, so that when the script is ran it grabs the current date and formats it and allows me to use that... (8 Replies)
Discussion started by: jeffs42885
8 Replies

7. Programming

Creating a bash based restricted shell

Hello. I need to write a command line interface that can be invoked either directly from the shell (command sub-command arguments), or as a shell that can process sub-commands. i want to use bash auto completion for both scenarios. example: lets say my CLI module is called 'mycli' and there... (5 Replies)
Discussion started by: noamr
5 Replies

8. Shell Programming and Scripting

Help with Creating file based on conditions

Can anyone please assist? I have a .txt file(File1.txt) and a property file(propertyfile.txt) . I have to read the vales from the property file and .txt file and create the output file(outputfile.txt) mentioned in the attachment. For each record in .txt file,the below mentioned values shall be... (20 Replies)
Discussion started by: vinus
20 Replies

9. UNIX for Dummies Questions & Answers

Creating a directory based on date

I want to create a directory based on date. I do not have date -d command. What I do have is: either use "date" command to get current date or DATE1=$(perl -e 'print scalar(localtime(time - 1 )), "\n";' |awk '{print $2,$3,$5}') |awk '{print $3}'can be modified to produce the desired year.... (3 Replies)
Discussion started by: newbie2010
3 Replies

10. Shell Programming and Scripting

Getting email output in single line with out space in email

I have tried below email method and i am getting every thing in single line . i have put echo to provide space, but it is not helping my code ( echo "From: $FROM" echo "To: $MAILTO" echo "CC: $CC" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo 'Content-Type: multipart/mixed;... (6 Replies)
Discussion started by: mirwasim
6 Replies
Merge(3pm)						User Contributed Perl Documentation						Merge(3pm)

NAME
Algorithm::Merge - Three-way merge and diff SYNOPSIS
use Algorithm::Merge qw(merge diff3 traverse_sequences3); @merged = merge(@ancestor, @a, @b, { CONFLICT => sub { } }); @merged = merge(@ancestor, @a, @b, { CONFLICT => sub { } }, $key_generation_function); $merged = merge(@ancestor, @a, @b, { CONFLICT => sub { } }); $merged = merge(@ancestor, @a, @b, { CONFLICT => sub { } }, $key_generation_function); @diff = diff3(@ancestor, @a, @b); @diff = diff3(@ancestor, @a, @b, $key_generation_function); $diff = diff3(@ancestor, @a, @b); $diff = diff3(@ancestor, @a, @b, $key_generation_function); @trav = traverse_sequences3(@ancestor, @a, @b, { # callbacks }); @trav = traverse_sequences3(@ancestor, @a, @b, { # callbacks }, $key_generation_function); $trav = traverse_sequences3(@ancestor, @a, @b, { # callbacks }); $trav = traverse_sequences3(@ancestor, @a, @b, { # callbacks }, $key_generation_function); USAGE
This module complements Algorithm::Diff by providing three-way merge and diff functions. In this documentation, the first list to "diff3", "merge", and "traverse_sequences3" is called the `original' list. The second list is the `left' list. The third list is the `right' list. The optional key generation arguments are the same as in Algorithm::Diff. See Algorithm::Diff for more information. diff3 Given references to three lists of items, "diff3" performs a three-way difference. This function returns an array of operations describing how the left and right lists differ from the original list. In scalar context, this function returns a reference to such an array. Perhaps an example would be useful. Given the following three lists, original: a b c e f h i k left: a b d e f g i j k right: a b c d e h i j k merge: a b d e g i j k we have the following result from diff3: [ 'u', 'a', 'a', 'a' ], [ 'u', 'b', 'b', 'b' ], [ 'l', 'c', undef, 'c' ], [ 'o', undef, 'd', 'd' ], [ 'u', 'e', 'e', 'e' ], [ 'r', 'f', 'f', undef ], [ 'o', 'h', 'g', 'h' ], [ 'u', 'i', 'i', 'i' ], [ 'o', undef, 'j', 'j' ], [ 'u', 'k', 'k', 'k' ] The first element in each row is the array with the difference: c - conflict (no two are the same) l - left is different o - original is different r - right is different u - unchanged The next three elements are the lists from the original, left, and right arrays respectively that the row refers to (in the synopsis, these are @ancestor, @a, and @b, respectively). merge Given references to three lists of items, "merge" performs a three-way merge. The "merge" function uses the "diff3" function to do most of the work. The only callback currently used is "CONFLICT" which should be a reference to a subroutine that accepts two array references. The first array reference is to a list of elements from the left list. The second array reference is to a list of elements from the right list. This callback should return a list of elements to place in the merged list in place of the conflict. The default "CONFLICT" callback returns the following: q{<!-- ------ START CONFLICT ------ -->}, (@left), q{<!-- ---------------------------- -->}, (@right), q{<!-- ------ END CONFLICT ------ -->}, traverse_sequences3 This is the workhorse function that goes through the three sequences and calls the callback functions. The following callbacks are supported. NO_CHANGE This is called if all three sequences have the same element at the current position. The arguments are the current positions within each sequence, the first argument being the current position within the first sequence. A_DIFF This is called if the first sequence is different than the other two sequences at the current position. This callback will be called with one, two, or three arguments. If one argument, then only the element at the given position from the first sequence is not in either of the other two sequences. If two arguments, then there is no element in the first sequence that corresponds to the elements at the given positions in the second and third sequences. If three arguments, then the element at the given position in the first sequence is different than the corresponding element in the other two sequences, but the other two sequences have corresponding elements. B_DIFF This is called if the second sequence is different than the other two sequences at the current position. This callback will be called with one, two, or three arguments. If one argument, then only the element at the given position from the second sequence is not in either of the other two sequences. If two arguments, then there is no element in the second sequence that corresponds to the elements at the given positions in the first and third sequences. If three arguments, then the element at the given position in the second sequence is different than the corresponding element in the other two sequences, but the other two sequences have corresponding elements. C_DIFF This is called if the third sequence is different than the other two sequences at the current position. This callback will be called with one, two, or three arguments. If one argument, then only the element at the given position from the third sequence is not in either of the other two sequences. If two arguments, then there is no element in the third sequence that corresponds to the elements at the given positions in the first and second sequences. If three arguments, then the element at the given position in the third sequence is different than the corresponding element in the other two sequences, but the other two sequences have corresponding elements. CONFLICT This is called if all three sequences have different elements at the current position. The three arguments are the current positions within each sequence. BUGS
Most assuredly there are bugs. If a pattern similar to the above example does not work, send it to <jsmith@cpan.org> or report it on <http://rt.cpan.org/>, the CPAN bug tracker. Algorithm::Diff's implementation of "traverse_sequences" may not be symmetric with respect to the input sequences if the second and third sequence are of different lengths. Because of this, "traverse_sequences3" will calculate the diffs of the second and third sequences as passed and swapped. If the differences are not the same, it will issue an `Algorithm::Diff::diff is not symmetric for second and third sequences...' warning. It will try to handle this, but there may be some cases where it can't. SEE ALSO
Algorithm::Diff. AUTHOR
James G. Smith, <jsmith@cpan.org> COPYRIGHT
Copyright (C) 2003, 2007 Texas A&M University. All Rights Reserved. This module is free software; you may redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-07-30 Merge(3pm)
All times are GMT -4. The time now is 02:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy