Sponsored Content
Top Forums Shell Programming and Scripting Send email with attachment in form of excel in unix Post 302134989 by bdebroy on Wednesday 5th of September 2007 02:41:46 AM
Old 09-05-2007
Send email with attachment in form of excel in unix

Hi,

The following in the code which I am using :

#!/bin/ksh
export ORACLE_HOME=/oracle/product/current
export PATH=$PATH:$ORACLE_HOME/bin

sqlplus -s schema/pswd@db <<EOF
set pagesize 200
set linesize 200
column Name format a25
column New_DeptName format a25
column Old_DeptName format a25
column New_Manager format a25
column Old_Manager format a25

spool $test.xls

SELECT a.first_name || ' ' || a.last_name Name, b.DEPTNAME New_DeptName ,
a.DEPARTMENT_NAME Old_DeptName, Get_New_Manager_Name(b.CS_DEPT_MGR_ID) New_Manager,
Get_Old_Manager_Name (a.manager_id) Old_Manager
FROM table1 a, table2 b,table3 c
WHERE a.emplid = c.emplid
AND a.EMPLID=b.emplid
AND b.EMPL_STATUS = 'A'
AND a.DEPARTMENT_ID <> b.deptid
order by Consultant_Name;
spool off
exit;
EOF


havingRows=`grep -c "no rows selected" $test.xls`;

if [ "$havingRows" -lt 1 ]; then
#mailx -s "this is a test" test@test.com <$test.txt
ux2dos $test.xls | uuencode test.xls | mailx -m -s "This is a test" test@test.com
fi
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Changing Unix form to Microsoft Word form to be able to email it to someone.

Please someone I need information on how to change a Unix form/document into a microsoft word document in order to be emailed to another company. Please help ASAP. Thankyou :confused: (8 Replies)
Discussion started by: Cheraunm
8 Replies

2. Shell Programming and Scripting

script that will send and email attachment

I'm looking for a sample of some code that will take the output from a file and generate an email that will include that text as an attachment. the script is in the borne shell. any help? (2 Replies)
Discussion started by: davels
2 Replies

3. Shell Programming and Scripting

send email from unix with attachment

Hello All, This is a common question that I found lot of results in the forums. I am trying to use uuencode to attach a file and send email. I have no issues sending email, but not able to attach any files using sendmail. Is uuencode part of sendmail or does 'uuencode' utility need to be... (1 Reply)
Discussion started by: chiru_h
1 Replies

4. AIX

Send email from unix (AIX) with PDF attachment

I am using the following command to send PDF attachment with a mail. uuencode <attachment.pdf> <attachment.pdf>|mailx -s <subject> <mail_id> < <Message_file.txt> This one send the message with attachment. I would like send PDF attachment with the mail Can any one help with this issue ? ... (0 Replies)
Discussion started by: sunjup
0 Replies

5. Shell Programming and Scripting

unable to send an email attachment

i know its pretty repeated query, but i need to post it in this new thread coz i need it urgently uuencode /var/tmp/chandra/emaillist.txt emaillist.txt | mail -s "message with encoded attachment" am unable to send the attachment emaillist.txt present in the path /var/tmp/chandra/ Is... (11 Replies)
Discussion started by: cmaroju
11 Replies

6. UNIX for Dummies Questions & Answers

How to send email attachment as read only in Linux

Hi, Could anyone help me to find soultion for the issue to send email attachment as read only. I can change the file permission in Linux and can send the email attachment from Linux. But my requirment is user can read the attachment but should not modified it . even user save the attachment... (4 Replies)
Discussion started by: calagar
4 Replies

7. UNIX for Advanced & Expert Users

How to send email as HTML format with attachment ?

hi.. Could somebody help me how to sent an attachment using sendmail command and the content is HTML format ?. Below is my code to sent the email as HTML but i do not know how to sent the attachment, please help me To: "BAHARIN HASAN"<baharin.hasan@gmail.com> from: "DATAONE SDN... (4 Replies)
Discussion started by: bh_hensem
4 Replies

8. Shell Programming and Scripting

Send a file through email using cron as an attachment

Hi All, I want to send a file as an attachment through cron job.Is this possible using cronjob nd if it i, can you please let me know how to do this? Thanks (2 Replies)
Discussion started by: NARESH1302
2 Replies

9. Shell Programming and Scripting

Not able to send attachment with the email

Hi All, The below code is working fine for me. mailx -s hello abc@xyz.com <<EOT Hello !!! How are you? Regards Rahul EOT But i am not able to send csv file with the mail .Getting just themail but not the attachment. uuencode /path/s1.csv | mailx -s hello abc@xyz.com <<EOT... (9 Replies)
Discussion started by: rafa_fed2
9 Replies

10. UNIX for Dummies Questions & Answers

Send email attachment using Operating System Script(UNIX) in Oracle Alerts

Good Day Kindly assist: I am creating an Alert that will notify supervisors of staff members who are due for probation report. I am using Operating System Script(Unix) as source.I have already developed the script. Now the challenge is if there are 3 employee records then the alert... (2 Replies)
Discussion started by: nosi27
2 Replies
sysman_intro(8) 					      System Manager's Manual						   sysman_intro(8)

NAME
sysman_intro - Introduction of SysMan applications DESCRIPTION
SysMan is a suite of applications for managing Tru64 UNIX systems. The SysMan applications provide a simple, easy to use, graphical user interface (GUI) for common system management tasks including installation and configuration. When you follow the installation instructions in the Installation Guide, the installation GUI, Installation Setup, is displayed automati- cally. To help you prepare the system for general use, the Tru64 UNIX: System Setup checklist is displayed when you log in as root for the first time after performing an installation. SysMan applications and help are available from the Application Manager (tool drawer) icon on the CDE front panel, or from the SysMan Applications panel above the SysMan Station icon on the root CDE window. For additional information, see the Welcome to SysMan help volume by performing the following procedure: Click on the Application Manager icon (the file drawer) on the CDE front panel. Double click on the System_Admin application group icon. Double click on the Welcome to SysMan icon. If you are not running CDE, but have installed it, you can open the Welcome to Sysman help volume by entering the following sequence of commands at the command line: /bin/sh PATH=$PATH:/usr/dt/bin export PATH DTHELPSEARCHPATH=/usr/dt/appconfig/help/C/%H export DTHELPSEARCH- PATH DTUSERSESSION=${USER}-`uname -n`-0 export DTUSERSESSION dthelpgen -dir $HOME/.dt/help/$DTUSERSESSION dthelpview -helpVolume browser SEE ALSO
Commands: bttape(8), bindconfig(8), diskconfig(8), dxaccounts(8), dxadvfs(8), dxarchiver(8), dxdw(8), dxfileshare(8), dxhosts(8), dxkernel- tuner(8), dxlicenses(8), dxlsm(8), dxpower(8), dxpresto(8), dxproctuner(8), dxshutdown(8), dxsysinfo(8), mailconfig(8), mailusradm(8), net- config(8), nfsconfig(8), printconfig(8), sysman(8), System Administration Release Notes Installation Guide Technical Overview X Window System Administrator's Guide Network Administration Common Desktop Environment: User's Guide CDE Companion Common Desktop Environment: Advanced User's and System Administrator's Guide Common Desktop Environment: Programmer's Overview Common Desktop Environment: Programmer's Guide Common Desktop Environment: Help System Author's and Programmer's Guide Common Desktop Environment: Style Guide and Certification Checklist OSF/Motif Style Guide sysman_intro(8)
All times are GMT -4. The time now is 10:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy