Adding a blank line in between two O/Ps in tabular format which gets received over email
Hi Guys,
I am stuck in between and seeking help here.
Requirement: A script that will run every morning which will connect to Mysql database and run the query to inform us about the holidays (it will also check if there were any holidays during last 2 business days). So the three queries are required to run.
for now, I have already written the script which sends the output over email in tabular format, however, I am unable to provide newline in between the two tabular outputs. Following is the script so far,
I am receiving the desired output, however, I need some blanklines to be separated from 2 query outputs.
Thanks
---------- Post updated at 05:11 AM ---------- Previous update was at 04:57 AM ----------
Ok, now it is sorted out. I have used the <br> tag.
You might consider using "plain text" as your mail format instead of HTML. This will make your mails smaller and less dangerous to handle (all the fancy Java-, Javascript- and whatnot-stuff used to install things you might not want to have installed will not work on plain text).
Increase efficiency.
Consider redirection in larger portions.
Or even better
Maybe you can save the loop and do everything in sed using its built-in loop?
This User Gave Thanks to MadeInGermany For This Post:
Yes, looping this will be good, however, in the output I am getting one extra <\/td> after every entry. O/p in the email attached: Below is the code:
Also, I could not understand the ${LINE// /<\/td><td>} part. Is it replacing the tab with </td><td>.
Please let me know. Once the output is sorted out, I need to optimize the script to run everyday which will fetch the data for today, t-1 and t-2 (provided all are business days).
For eg: If today is Tuesday, then the query will be executed 3 times for today, Monday, friday and send the output (if any) over email. No blank emails required.
Currently, I am just checking the output format with hardcoding the date, however, above is the overall requirement of the script.
Hello Guys,
developing a monitoring shell script to have my queue depth count over mail .
here is the sample input file to the script which has all the queue names 1 : DISPLAY QUEUE(*) WHERE (CURDEPTH GT 0)
ZFC8409: Display Queue details.
QUEUE(QL.GVR.ATA.CACHE.01) ... (10 Replies)
Dears Please support
I have out put in text file and look like below
fixed inquiries - Click on MAX suffix http://server:port/app
User Details http://server:port/app
Audit User Detail Action hhttp://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app
User Details ... (13 Replies)
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Hi
I want to display the following input data into the tabular format as shown in the output.
Input.txt:
Following jobs are in pending state for more than 10 minutes:
JOB_ID JOB_SUBMIT_ID
MAHAR 784308
PUNJA 109367
Following jobs are running for longer time:
JOB_ID... (1 Reply)
I use the following as part of a script to correct for a faulty hostname file.
# get the domain name
read -r thehostname < /etc/hostname
dom="$(echo $thehostname | cut -d'.' -f2)"
numchar=${#dom}
if
then
echo "It appears as though the hostname is not correctly set."
echo "Hostname has... (5 Replies)
Hello...
I have a file which contain certain number of records.
I want to generate another file from this file which will contain 1st line as a blank line & after every 5 lines one blank line will be inserted. How to achieve this through shell scripting?
Thanks... (5 Replies)
the following range matching works great but i wish to add a blank line after each range result set... which i've tried and researched to no avail
MY INPUT DATA:
CURRENT CODE I'M USING:
sed -n '/*$/,/;/p' $INPUT_FILE
RESULTS I'M GETTING:
RESULT I looking to... (5 Replies)
Hello friends,
I have a C source code containing sql statements. I use the following sed command to print all the sql blocks in the source code....
sed -n "/exec sql/,/;/p" Sample.cpp
The above sed command will print the sql blocks based on the pattern "exec sql" & ";"... (2 Replies)
I followed the egrep example given in the thread "parse text or complex grep ?". It is exactly what I need...except... how do I insert a blank line after the second line? My exact command is:
egrep 'patt1|patt2' filename
the result is:
patt1
patt2
patt1
patt2
and so on. I would... (2 Replies)