![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| mailx commannd - Mail and Attachment in same mail | sharif | UNIX for Advanced & Expert Users | 6 | 03-19-2008 04:25 PM |
| mail with attachment | param786 | Shell Programming and Scripting | 1 | 07-15-2007 11:20 AM |
| How To Add Attachment to Mail | lesstjm | Shell Programming and Scripting | 3 | 12-06-2005 11:24 AM |
| mail attachment | sushrut | UNIX for Dummies Questions & Answers | 3 | 08-28-2001 02:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
search a string and mail it as attachment
Hi All,
I need to search a text in a string, assign it to a variable. Ex : I need to get the number that has gif extension. The number is not constant. The search value should return as 1174499845 from the following string. x 1174499845.gif, 133982 bytes, 262 tape blocks Go to relevant directory, search for the the variable (example 1174499845) in the directory. if exists Mail it as attachment else display "required attachment" not available. Thanks in advance. Jagadeesh Tata. |
|
||||
|
Here's a rough ideal on what you need to do.. Assuming you are just looking for one file at a time.
ls ${DIR} | grep "$VARIABLE" if [ $? -eq 0 ] then <do mail command here, unsure how to do attachment as this moment> fi Quote:
|
|
||||
|
Text files can easily be sent as the body of an email as shown above. If you need to send something as an attachment, you have to encode it. I like mpack, but have used uuencode as well. Here's my snippets:
cat filename | uuencode attachmentName | mailx –m –s “Subjest” someone@somewhere.com #/usr/local/bin/mpack -s "Test Email" -c application/octet-stream ./oracle_trace_file.trc me@myaddress.com |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| mailx, mailx attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|