10-01-2002
File contents required for emailing.
I have created three SQL scripts that are run by one central script. What I need to do is verify the output file from the three SQL scripts(KSH Scripts) is worth emailing. This I would like to do by verifiying the contents of the result file.
The contrlooing script creates the result file then the SQL scripts append to it from then on until the opreation completes.
For instance I have ecohed a line for each instance of the SQL script being run into the result file. So there are three lines minimum in the result file, what I would like to do is count the lines if ther are more that three line email the file, if ther are less just delete the file.
I am having trouble assinging a varialbe to the lines counted in the result file.
I have tried;
wc -l result_file
let line_c=$a-$b
if [ lin_c -le 3 ]; then
Email file
else
delete file
fi
HELP!!!!!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am not sure how to start doing this so I hope to get some advice as to how to start.
I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format:
"CONTINENT","COUNTRY","CITY","ID"
"asia","japan","tokyo","123"... (21 Replies)
Discussion started by: ReV
21 Replies
2. Shell Programming and Scripting
My data is something like shown below.
date1 date2 aaa bbbb ccccc
date3 date4 dddd eeeeeee ffffffffff ggggg hh
I want the output like this
date1date2 aaa eeeeee
I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies
3. UNIX for Dummies Questions & Answers
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies
4. Shell Programming and Scripting
Hi everyone,
I am new to unix and bash and in need of some help.
I am writing a script that will execute a SQL query. The script runs and the SQl query runs, but I cannot figure out how to save the results as a file that can be emailed to a user. Here is my scripts thus far:
#!/bin/sh
SID=$1... (2 Replies)
Discussion started by: alpinescott
2 Replies
5. Shell Programming and Scripting
Hi All,
I want to send the html file as message body not as an attachment. below is my code.it is printing the html code as it is in the email.
your help is needed urgently.
VTIER=$ROOTHOME/vtierlist2.txt
genhtml=/$ROOTHOME/genhtml.html
MAILTO=/$ROOTHOME/maillist
SUBJECT="Vtier Usage... (6 Replies)
Discussion started by: amitbisht9
6 Replies
6. Shell Programming and Scripting
Hi,
I want to delete the contents of a file which are matching with contents of other file in shell scripting.
Ex.
file1
sheel,sumit,1,2,3,4,5,6,7,8
sumit,rana,2,3,4,5,6,7,8,9
grade,pass,2,3,4,5,6,232,1,1
name,sur,33,1,4,12,3,5,6,8
sheel,pass,2,3,4,5,6,232,1,1
File2... (3 Replies)
Discussion started by: ranasheel2000
3 Replies
7. Shell Programming and Scripting
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
Discussion started by: seeki
2 Replies
8. Shell Programming and Scripting
Hi,
First of all sincere apologies if I have posted in a wrong section ! Please correct me if I am wrong !
I am very new to UNIX scripting.
Currently my problem is that I have a code file at the location /home/usr/workarea/GeneratedLogs.log :-
Code :-
(Feb 7, 571 7:07:29 AM),... (4 Replies)
Discussion started by: acidburn_007
4 Replies
9. Shell Programming and Scripting
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Discussion started by: vivek d r
2 Replies
10. Shell Programming and Scripting
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
LEARN ABOUT DEBIAN
sql::translator::producer::diagram
SQL::Translator::Producer::Diagram(3pm) User Contributed Perl Documentation SQL::Translator::Producer::Diagram(3pm)
NAME
SQL::Translator::Producer::Diagram - ER diagram producer for SQL::Translator
SYNOPSIS
Use via SQL::Translator:
use SQL::Translator;
my $t = SQL::Translator->new(
from => 'MySQL',
to => 'Diagram',
producer_args => {
# All args are optional
out_file => 'schema.png',# if not provided will return from translate()
output_type => 'png', # is default or 'jpeg'
title => 'My Schema', # default is filename
font_size => 'medium', # is default or 'small,' 'large'
imap_file => '', # filename to write image map coords
imap_url => '', # base URL for image map
gutter => 30 # is default, px distance b/w cols
num_columns => 5, # the number of columns
no_lines => 1, # do not draw lines to show FKs
add_color => 1, # give it some color
show_fk_only => 1, # show only fields used in FKs
join_pk_only => 1, # use only primary keys to figure PKs
natural_join => 1, # intuit FKs if not defined
skip_fields => [...], # list* of field names to exclude
skip_tables => [...], # list* of table names to exclude
skip_tables_like => [...], # list* of regexen to exclude tables
}
) or die SQL::Translator->error;
$t->translate;
* "list" can be either an array-ref or a comma-separated string
AUTHOR
Ken Youens-Clark <kclark@cpan.org>.
perl v5.14.2 2012-01-18 SQL::Translator::Producer::Diagram(3pm)