![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use "mail" to attach a file with an email? | meili100 | UNIX for Dummies Questions & Answers | 2 | 02-23-2008 03:49 AM |
| uuencode: command not found when sending mail in LINUX | bsandeep_80 | UNIX for Advanced & Expert Users | 2 | 10-02-2007 09:48 AM |
| How to attach a file & send mail thru script | Mar1006 | Shell Programming and Scripting | 9 | 10-12-2006 09:54 AM |
| Need to attach a txt file while sending mail | charan81 | Shell Programming and Scripting | 9 | 01-12-2006 01:44 AM |
| How to attach a file in mail? | firebirdonfire | UNIX for Dummies Questions & Answers | 1 | 03-29-2001 08:38 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to attach a file in Linux mail command
How to attach a file in Linux mail command
Hi Guys, Is there any way to attach a file in Linux mail command without using "uuencode"? i.e. Code: file=/a/b/c/d/file.txtmail -s "Giga aks" abc@123.com <<HDoc`uuencode $file $file 2>/dev/null`HDoc Here, I don;t want to use 'uuencode' command but want $file to be sent in the email as an attachment. #2 (permalink) Also, when I'm putting the below code (PSee inside `` backquotes) i.e. calling uuencode withing a for loop inside another parent for loop, something strange is happening. Quote: `for comp in $(ls -c Directory); do echo $comp;echo ===========; for file in $(find Directory/$comp -type f); do uuencode $file $file 2>/dev/null; done ; done` Instead of showing each component in the email body and attaching the files under each $comp (a subfolder), this command is making a .txt file of the echo statement (except for the first iteration) i.e. for (echo $comp and echo ============ I want the output like: --------------------------------------------------- HTML Code: subfolder1===========<path1>/file1 <path1>/file2 <path1>/file3subfolder2===========<path2>/file4 <path2>/file5 --------------------------------------------------- Where, subfolder[12] are 2 folders inder Directory folder and path[12] are 2 different path which will be shown in the attachments/attached files in the email. and file[12345] are the files under those subfolders. Note: Subfolder[12] and "===========" line under it should come in the email as simple text but the files under that should be shown as attachments under each subfolder[?] (which i think in using Linux Mail command is not possible as you have to configure your outlook email appliation). Doesn't matter if I get the file[12345] in my email ...all together as attachments..as anyone can easily see the <path?> of a file[?] making a feel that this file is at that path. But, by using the above command within ``(backquotes)... what Linux is doing is: Im getting only the following in the email body as text data : --------------------------------------------------- HTML Code: subfolder1=========== --------------------------------------------------- and the below things are showing up as attached files... including the echo statement for 2nd subfolder2 and ========== line. <path1>/file1 <path1>/file2 <path1>/file3 subfolder2 =========== <path2>/file4 <path2>/file5 If you want to try ... just create a folder Directory using another folder which contains some sub folders and files under that... and you'll get to know what i want to achieve. I can provide more information in case anyone needs. Thanks- |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|