Move contents of a directory into one file for e-mail distribution ...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Move contents of a directory into one file for e-mail distribution ...
# 1  
Old 04-23-2009
Move contents of a directory into one file for e-mail distribution ...

Hello,

Here is what I am trying to accomplish.

I am going to have one directory in which there will be files of varying types (Excel, Word, PPT, and possible others), and I need to be able to be bundle however many files there are in there together in to one file to be used as an e-mail attachment that I would like the recipient to be able to open and extract the files. The files would be for information only. The will not need to do anything to any directories on the recipients system.

I have tried tar and tar did what I wanted it to do as far as bundling them up into one file but upon extraction the files are unreadable. I saved the group files into a file and I told tar to use .zip for its extention. Perhaps I am a mere tweak away from using this but I don't know what else to do using this as a solution.

gzip, unless I am using it wrong, did not do what I need for it to do at all.

I use mpack to create the e-mail with the attachment and then use sendmail to send to the recipient.

I have read many of the other posts about gathering files but I think what I am attempting to do is not a repeat of what has been asked before.

Thanks for any help that can be given.

Last edited by rip73; 04-23-2009 at 01:02 PM.. Reason: Want to re-do the title
# 2  
Old 04-23-2009
Did you uuencode your file before emailing it out?
# 3  
Old 04-23-2009
Quote:
Originally Posted by giannicello
Did you uuencode your file before emailing it out?
No, I did not. Not familiar with uuencode.
# 4  
Old 04-25-2009
Quote:
Originally Posted by rip73
I saved the group files into a file and I told tar to use .zip for its extention.
... thus possibly triggering the wrong (i.e. unzip) mechanism to untar the mislabeled archive (?).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

2. Shell Programming and Scripting

If contents of A are in B then move the common contents to C

Hallo Team, I have 2 .csv files file A has 47600 lines and file B has 67000 lines FILEA SD0o9rb01-1d320ddbcc8d220f572739ebed5f58d1-v300g00 SD8bt0101-a0810bfe0e3396060126ec51b30dac0a-v300g00 SD05sce01-cb056af347ed4651f29eb3c3e9addbd6-v300g00... (3 Replies)
Discussion started by: kekanap
3 Replies

3. UNIX for Dummies Questions & Answers

Move Directory & Contents Between Two Machines

Hi All, I have a large amount of files that I need to copy from one server to another server using SFTP. Can comeone please help me with the command I would use here? Here is what I am thinking, but being new at this I know this is probably wrong: Login to the destination host using... (1 Reply)
Discussion started by: SalientAnimal
1 Replies

4. Shell Programming and Scripting

move contents from one file to another based on line number or content

I want a script that will move everything beyond a certain line number or beyond a certain content word into another file. For example, if file A has this: first line second line third line forth line fifth line sixth line I want to run a script that will move everything beyond the third... (4 Replies)
Discussion started by: robp2175
4 Replies

5. Shell Programming and Scripting

Mail the contents of a file in perl

Hi, I'm trying to read the contents of a file (message.txt), put them in a mail and then mail it This is what I have thus far but I having trouble referencing the file. I'm trying to put it into an array so any ideas would be helpful ... $to='user.n@domain.com'; $from= 'username';... (7 Replies)
Discussion started by: cillmor
7 Replies

6. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

7. Shell Programming and Scripting

Copy contents of a directory only if a file exists

I'm looking to write a script that will check the contents of a directory, and if any files exist in that directory copy them to a temporary folder. The target files are only resident for a few seconds, so I think the script needs to be running constantly. Any pointers would be really... (3 Replies)
Discussion started by: danceofillusion
3 Replies

8. Shell Programming and Scripting

Round Robin Distribution of Contents of file to 3 files

Hi I need to create a script that distributes in round robin fashion the contents of a file to 3 files. The number of lines in a content of file can vary from 1-n(Each line is just a one letter word).The entire lines needs to get distributed into 3 files ( The order doesnt matter) , at... (5 Replies)
Discussion started by: police
5 Replies

9. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

10. Shell Programming and Scripting

SED To insert Directory Contents to file

I am on a HP-UX machine I have a directory called "/u01/blobs" and the files look like this: ls -1 7398 7399 7400 I need to produce a comma delimited file with the following format: filename,location/filename i.e: 7398,/u01/blobs/7398 7399,/u01/blobs/7399 7400,/u01/blobs/7400 What... (3 Replies)
Discussion started by: NomDeGuerre
3 Replies
Login or Register to Ask a Question