![]() |
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 |
| script to send a file in email | dr46014 | Shell Programming and Scripting | 2 | 12-10-2007 08:38 AM |
| error-when trying to send the message thru email. | MARY76 | Shell Programming and Scripting | 5 | 02-06-2007 04:10 PM |
| send a message through email to 5 people using unix script. | MARY76 | UNIX for Advanced & Expert Users | 3 | 02-05-2007 03:42 PM |
| send a message through email to 5 people using unix script? | MARY76 | Shell Programming and Scripting | 2 | 02-05-2007 03:29 PM |
| How to send file contents to email | teaspoon_ver2 | UNIX for Advanced & Expert Users | 4 | 01-11-2007 04:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
how to send contents of a file to email as a message
i have a file new1.txt
i want to send the contents of that file as a message to email ali@sms.com i m using ksh script......... plz help me |
|
||||
|
Quote:
use following ... Subject="mailing you buddy.." MAIL_RECIPIENTS="ali@sms.com, xyz@abccom" cat new1.txt | mailx -s "$Subject" $MAIL_RECIPIENTS Thanks |
|
|||||
|
actually i have a file
#!/bin/ksh echo " ************************************ " >> perst echo " The following apps are running currently indicated by their number" >> perst for i in Archiver1 Cleaner1 Archiver2 Interpolation DBMaint ImportAdapter_CC Extrapolation ZeroConsumptionReport DBSyncListener TnsProvAdapterCheckConfig do count=0 count=`ps -aef | grep java | grep $i | wc -l` echo $i $count >> perst ps -aef | grep java| grep $i >> /tmp/new1.txt done echo " ********************************************** " >> perst mail -s "Plz find the attachment for the currently Running application" naveed@cap.com < /tmp/new1.txt Hi, This Attachment contains the list of all the Applications Running Currently on mdcaedn03.tu.com Thanks Ali Naveed -------------------------------------------------------------------------can u tell me why i m not getting the content of file new1.txt in my mail |
|
||||
|
Quote:
Above Boldfaced, shows redirection but whats the command in it ?? it should be .. mail -s "Plz find the attachment for the currently Running application" naveed@cap.com < cat /tmp/new1.txt Otherwise use pipe as I gave the example previously.. cat /tmp/new1.txt | mail -s "Plz find the attachment for the currently Running application" naveed@cap.com Try this one..hope it'll work. ![]() |
|
||||
|
instead of using the mail command, use mailx.
it should be like this: mailx -s "Plz find the attachment for the currently Running application" naveed@cap.com < /tmp/new1.txt I just checked the functionality of this in my unix environment: echo "Hi hw are you" > /tmp/new1.txt mailx -s "kshfks" myid@domain.com < /tmp/new1.txt And I got the mail in my domain |
![]() |
| Bookmarks |
| Tags |
| mailx, mailx attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|