Sponsored Content
Top Forums Shell Programming and Scripting Sending email with multiple files.. Post 302467526 by DGPickett on Friday 29th of October 2010 04:39:19 PM
Old 10-29-2010
First, logfiles are just text, so you could just append them into the body of the email. If they must be attachments, you need a more sophisticated mail client.
Code:
(
 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."
for filename in /space/dbexport/PHR/data/conditionExport_test.csv /space/dbexport/PHR/data/encounterExport.csv /space/dbexport/PHR/data/procedureExport.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 "$logfile", "$logfile1", "$logfile2", "$logfile3"
echo ""
done

 for log in logdir/*.YYYYMMDD.*
 do
  echo ============== ${log~~*/} ====================
  cat $log
  echo
  echo =========================================
  echo
done | mailx -s "$subject" "$to" id11355@gmail.com

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending Multiple Files through email

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)
Discussion started by: nbvcxzdz
4 Replies

2. Shell Programming and Scripting

Sending mutiple files thru email to lotus notes

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)
Discussion started by: lapisguy
4 Replies

3. Shell Programming and Scripting

Sending an email with more than one files

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)
Discussion started by: thambi
7 Replies

4. HP-UX

Sending Unix files as attachments in an email

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)
Discussion started by: sangharsh
7 Replies

5. HP-UX

Sending email to multiple IDs

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)
Discussion started by: sangharsh
3 Replies

6. UNIX for Dummies Questions & Answers

Zipping files and sending email

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)
Discussion started by: win4luv
2 Replies

7. Shell Programming and Scripting

sending multiple files along with mail message using uuencode

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)
Discussion started by: sachinkl
1 Replies

8. Solaris

Sending Mails to the Multiple Email Address

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)
Discussion started by: Pramod_009
5 Replies

9. Shell Programming and Scripting

Sending files to multiple emails

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)
Discussion started by: ROCK_PLSQL
2 Replies

10. Shell Programming and Scripting

Sending multiple files using uuencode command

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)
Discussion started by: Swapnil Mawle
1 Replies
HIER(7) 					       BSD Miscellaneous Information Manual						   HIER(7)

NAME
hier -- layout of filesystems DESCRIPTION
A historical sketch of the filesystem hierarchy. The modern OS X filesystem is documented in the ``File System Programming Guide'' available on Apple Developer. / root directory of the filesystem /bin/ user utilities fundamental to both single-user and multi-user environments /dev/ block and character device files fd/ file descriptor files; see fd(4) /etc/ system configuration files and scripts /mach_kernel kernel executable (the operating system loaded into memory at boot time). /sbin/ system programs and administration utilities fundamental to both single-user and multi-user environments /tmp/ temporary files /usr/ contains the majority of user utilities and applications bin/ common utilities, programming tools, and applications include/ standard C include files arpa/ C include files for Internet service protocols hfs/ C include files for HFS machine/ machine specific C include files net/ misc network C include files netinet/ C include files for Internet standard protocols; see inet(4) nfs/ C include files for NFS (Network File System) objc/ C include files for Objective-C protocols/ C include files for Berkeley service protocols sys/ system C include files (kernel data structures) ufs/ C include files for UFS lib/ archive libraries libexec/ system daemons & system utilities (executed by other programs) local/ executables, libraries, etc. not included by the basic operating system sbin/ system daemons & system utilities (executed by users) share/ architecture-independent data files calendar/ a variety of pre-fab calendar files; see calendar(1) dict/ word lists; see look(1) web2 words from Webster's 2nd International words common words man/ manual pages misc/ misc system-wide ascii text files mk/ templates for make; see make(1) skel/ example . (dot) files for new accounts tabset/ tab description files for a variety of terminals; used in the termcap file; see termcap(5) zoneinfo/ timezone configuration information; see tzfile(5) /var/ multi-purpose log, temporary, transient, and spool files at/ timed command scheduling files; see at(1) backups/ misc. backup files db/ misc. automatically generated system-specific database files log/ misc. system log files mail/ user mailbox files run/ system information files describing various info about system since it was booted utmpx database of current users; see utmpx(5) rwho/ rwho data files; see rwhod(8), rwho(1), and ruptime(1) spool/ misc. printer and mail system spooling directories mqueue/ undelivered mail queue; see sendmail(8) tmp/ temporary files that are kept between system reboots folders/ per-user temporary files and caches SEE ALSO
ls(1), apropos(1), whatis(1), whereis(1), finger(1), which(1), find(1), grep(1), fsck(8) HISTORY
A hier manual page appeared in Version 7 AT&T UNIX. BSD
July 23, 2007 BSD
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy