I tried this, but it did'nt work.
I twisted the script a bit, and i am getting the output as
The shell script is: ---------- Post updated at 11:01 AM ---------- Previous update was at 10:59 AM ----------
Quote:
Originally Posted by msrahman
I tried this, but it did'nt work.
I twisted the script a bit, and i am getting the output as /SPACE/DBEXPORT/PHR/DATA/CONDITION: 2000 log file path is:
/space/dbexport/PHR/log/condition-20101101.log
/space/dbexport/PHR/log/encounter-20101101.log
/space/dbexport/PHR/log/procedure-20101101.log
/space/dbexport/PHR/log/provider-20101101.log
========= END ======= /SPACE/DBEXPORT/PHR/DATA/ENCOUNTER: 1000 log file path is:
/space/dbexport/PHR/log/condition-20101101.log
/space/dbexport/PHR/log/encounter-20101101.log
/space/dbexport/PHR/log/procedure-20101101.log
/space/dbexport/PHR/log/provider-20101101.log
========= END =======
I want the output to be displayed as shown below: /SPACE/DBEXPORT/PHR/DATA/CONDITION: 2000 log file path is: /space/dbexport/PHR/log/condition-20101101.log
/SPACE/DBEXPORT/PHR/DATA/ENCOUNTER: 1000 log file path is: /space/dbexport/PHR/log/encounter-20101101.log
/SPACE/DBEXPORT/PHR/DATA/PROCEDURE: 1000 log file path is:
/space/dbexport/PHR/log/procedure-20101101.log
/SPACE/DBEXPORT/PHR/DATA/PROVIDER: 150 log file path is: /space/dbexport/PHR/log/provider-20101101.log
The shell script is:
(
echo "CONDITION, ENCOUNTER & PROCEDURE LOAD PROCESS FINISHED SUCCESSFULLY."
echo "Input file path and the total records it contains and loaded into the table's are shown below."
echo "________________________________________________________________________"
for filename in /space/dbexport/PHR/data/conditionExport_test.csv /space/dbexport/PHR/data/encounterExport.csv /space/dbexport/PHR/data/procedure
Export.csv /space/dbexport/PHR/data/providerExport.csv
do
# get description from filename, convert to uppercase
#
desc=$(echo $filename|sed 's/Export.*csv//'|tr '[a-z]' '[A-Z]')
# get total record count from file
#
n=$(wc -l < $filename)
echo "$desc: $n"
echo "log file path is:"
echo
echo /space/dbexport/PHR/log/condition-`date +%Y%m%d`.log
echo
echo /space/dbexport/PHR/log/encounter-`date +%Y%m%d`.log
echo
echo /space/dbexport/PHR/log/procedure-`date +%Y%m%d`.log
echo
echo /space/dbexport/PHR/log/provider-`date +%Y%m%d`.log
echo
echo ========= END =======
done
) | mailx -s "$subject" "$to" id11355@gmail.com
Note: The user should get the log file path along with the log file as an attachment of all the 4 files. The attachment can be a .txt file too.
Last edited by Scott; 11-01-2010 at 04:44 PM..
Reason: Code tags again...
Hi Everyone,
I'm using the uuencode command with the mail command to send out emails through a UNIX script. The problems is that i have a number of gif files that i need to attach to a single email but the number and name of the gif files is not static. Example today the folder home/Desktop may... (4 Replies)
Hi All,
I am currently using the following script to send the single file to one/more email addresses. I need to send mutilple files at same time, are there anyway I could modify the script or write new one to accomplish the same.
Script
***************
#!/bin/ksh
# Author: Manish... (4 Replies)
Hi,
I would like to send an email with more than one attachement. I am using uuencode. I want to achive by suing uuencode. Also please let me know other ways.
-Thambi (7 Replies)
Hi,
I am executing the following command in order to send a file as an attachment:
mailx -s "Subject" emailID@xyz.com < Testfile.txt
Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Hi,
I am trying to send an email to multiple IDs from Unix script. I have given the EmailIds in a file and trying to use the file as input in the script.
> cat Email
EmailID = "abc@xyz.com cbz@xyz.com"
In my script I have
. /Email
mailx -s "subj" $EmailID
This fails with the... (3 Replies)
Hi,
I need to zip 4 files and send an email attaching the zipped files...
Pls help..
Win
---------- Post updated at 10:49 AM ---------- Previous update was at 10:36 AM ----------
Hi,
I need to convert 4 text files into xls,zip these 4 files and send an email attaching the... (2 Replies)
Hi,
I have a requirement to send a mail with multiple files attached to it and along with the text message in the mail.
I am trying sumthing like below but it only sends me the text message and no files attached to the mail.
----------------------------------------
( uuencode file1... (1 Reply)
Hi All,
I am pretty new to the mail service in Sun Solaris 5.10. If anybody help me in writing a script for the multiple recipient with subject and the body would be a helpful.
Kindly help...
Thanks in advance. :)
Warm Regards,
Pramod (5 Replies)
Hi All,
I want to send each file to each email id as below.
Instead of writing saparate 10 mail commands
can we do it in a simple step.
file1.csv to raghu.s@hps.com
file2.csv to kiran.m@hps.com
file3.csv to kenni.d@hps.com
file4.csv to rani.d@hps.com
file5.csv to sandya.s@hps.com... (2 Replies)
Hi All,
I want to send multiple CSV file using below code. In Result folder, we have multiple CSV files. However, I want to catch only Summary CSV files.
I was trying using *, % with different combination. However, not able to do so.
From below code, I could send only one file... (1 Reply)