Sponsored Content
Top Forums Shell Programming and Scripting Trying to send an excel spreadsheet. Post 302316194 by NycUnxer on Thursday 14th of May 2009 10:40:54 AM
Old 05-14-2009
Trying to send an excel spreadsheet.

And I have to modify this part of the script, I'm not sure what to change the content-type to for this to work, or what else I would need to change here:

Code:
# This script sends Email  acoording to command line arguments.
# $1 - file to be attached (full path with name)
# $2 - file name as it shows on Email (can be any name)
# $3 - recipient list (separated by commas)
# $4,$5,$6,$7 - Subject (up to 4 words)

   echo "Subject: $4 $5 $6 $7"  > alerts
   echo "TO: $3" >> alerts
   echo "Content-type: multipart/mixed; \
boundary=\"Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)\"" >> alerts
echo "\nThis is a multi-part message in MIME format.\n" >> alerts
echo "--Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)" >> alerts
echo "Content-type: text/plain; charset-iso-8859-1" >> alerts
echo "Content-transfer-encoding: 7BIT\n" >> alerts
   date >> alerts
   echo "\nDO NOT REPLY TO THIS EMAIL" >> alerts
if [ "$1" = NO ] ; then
        :
else
echo "\n--Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)" >> alerts
echo "Content-type: text/plain; name=$2" >> alerts
echo "Content-transfer-encoding: 7BIT" >> alerts
echo "Content-disposition: attachment; filename=$2\n" >> alerts
cat $1 >> alerts
fi
echo "\n--Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)--" >> alerts

Please suggest what to change so I can mail the excel spreadsheet. Thanks again.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is it possible to import a Unix directory into an Excel spreadsheet

Does anyone know if it's possible to import a Unix directory into an Excel spreadsheet? I'm trying to create a report based on about several thousand files within a Unix server directory, I was thinking if I could import the directory into a spreadsheet it would be easier to sort the data based... (2 Replies)
Discussion started by: Arkitech
2 Replies

2. Shell Programming and Scripting

Send email with attachment in form of excel in unix

Hi, I have a shell script which send email with an attachment in the form of an email. However, the when I open the attachment, all the data comes in one column. How do I format the data in the excel sheet while sending the email? Thanks (8 Replies)
Discussion started by: bdebroy
8 Replies

3. UNIX for Dummies Questions & Answers

Download to unix/linux from excel spreadsheet

Hi all, I am not a computer programmer nor a computer specialist but I do create some Excel speadsheets and I need to download the data generated from Excel to a Unix/linux programmed screen. Do you know if there is a way or a "trick" that could make this data transfer automated so it would... (2 Replies)
Discussion started by: claude73
2 Replies

4. Shell Programming and Scripting

How to send a repost as a Excel file...?

Hi All, Have a file in solairs and want to send it as a Excel file...! Yes i getting it as .csv file...! but it's not looking gud.. how i can add colos into it..? Generate report in Excel, with color and it should look good..! (1 Reply)
Discussion started by: bullz26
1 Replies

5. Shell Programming and Scripting

How to convert the data into excel sheet and send mail using 'mailx' command

Hi all I have a shell script that uses a stored proc to generate output from some tables and send the same in an e-mail using mailx command. Now I need to convert the output to excel format and send e-mail. How can I achieve this. Please help me in this regard, as it's very urgent and I have been... (5 Replies)
Discussion started by: sanbabu
5 Replies

6. Shell Programming and Scripting

UNIX -> send data as excel in seperate cells

Hi I have a data file in UNIX as follows. I need to send this file in Mail as excel format. but the problem i face is i get the data all in single cells per row. what can i do to get the data in seperate cells. File -> attachment.xls data data data data data1 data1 ... (1 Reply)
Discussion started by: vj8436
1 Replies

7. AIX

Trying to send an excel spreadsheet.

I may have posted in the wrong section, either way I need some help. And I have to modify this part of the script, I'm not sure what to change the content-type to for this to work, or what else I would need to change here: # This script sends Email acoording to command line arguments. #... (1 Reply)
Discussion started by: NycUnxer
1 Replies

8. Programming

extract the same format from existing excel file using " Spreadsheet::ParseExcel " module

Hi , can any one tell me,"How to extract the same format from existing excel file to new excel file " using Spreadsheet::WriteExcel or Spreadsheet::ParseExcel module ??? Example_pgm: Below program is used to read existing excel file..In this program "my $cell = $_;" line is used to... (0 Replies)
Discussion started by: kavi.mogu
0 Replies

9. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

10. Shell Programming and Scripting

UNIX - how to send attach excel in mail

Hi Experts, i need your help here :confused: Need to send a report thru mail using unix shell script(AIX). can you help me to do this? . i tried "uuencode" with CSV format, but while reading report all values are in single column. i need each column values in separate cell. Thanks in... (9 Replies)
Discussion started by: newbieabc
9 Replies
echo(1B)					     SunOS/BSD Compatibility Package Commands						  echo(1B)

NAME
echo - echo arguments to standard output SYNOPSIS
/usr/ucb/echo [-n] [argument] DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output. echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi- ronment variables. For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows: o echo your current-working-directory's full pathname o pipe the output through tr to translate the path's embedded slash-characters into space-characters o pipe that output through wc -w for a count of the names in your path. example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w" See tr(1) and wc(1) for their functionality. The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's echo() also understands a as the audible bell character; however, these commands do not have an -n option. OPTIONS
-n Do not add the NEWLINE to the output. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5) NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases. SunOS 5.11 3 Aug 1994 echo(1B)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy