- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scripting: how to mail an file as attachment on hp...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2002 11:43 PM
10-20-2002 11:43 PM
I want to write an script which mails an tar to file to some email-addresses. How does it works ?
I read man mailx but found no way. Any idea ?
Thanx in adv.
Regards
Stephan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2002 11:45 PM
10-20-2002 11:45 PM
Re: scripting: how to mail an file as attachment on hp-ux
Try this :
http://hpux.connect.org.uk/hppd/hpux/Users/mpack-1.5/
Regards,
Patrice MARTINACHE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2002 11:54 PM
10-20-2002 11:54 PM
Re: scripting: how to mail an file as attachment on hp-ux
I also often use mpack, but for a simple tar file you could use :
shar -cZ tar_file | mailx -s "subject" email
regards,
Jean-Louis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2002 11:54 PM
10-20-2002 11:54 PM
SolutionThis is a small script, which will do what you require.
#!/bin/sh
MAILFILE=/tmp/mailtemp
HEADER=/tmp/header
clear
echo "Enter the email address: \c"
read TO
echo "Enter the Cc email address: \c"
read CC
echo "Enter the Bcc email address: \c"
read BCC
echo "Enter the Subject: \c"
read SUBJECT
echo "Enter the Body: \c"
read BODY
echo "Enter the filename of the attachment: \c"
read DATAFILE
echo To: $TO >> $HEADER
echo Cc: $CC >> $HEADER
echo Bcc: $BCC >> $HEADER
echo Subject: $SUBJECT >> $HEADER
echo "" >> $HEADER
echo "" >> $HEADER
echo $BODY >> $HEADER
echo "" >> $HEADER
cat $HEADER > $MAILFILE
uuencode $DATAFILE $DATAFILE.doc >> $MAILFILE
cat $MAILFILE | /usr/lib/sendmail -t
rm $MAILFILE
rm $HEADER
I got this from the forum but cannot remember from whom, so apologies to initial author.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 04:37 AM
10-21-2002 04:37 AM
Re: scripting: how to mail an file as attachment on hp-ux
I gleaned this from the forums a couple of weeks ago, particularly from posts of Rita C. Workman. It works well.
Create an "include" file containing this line:
[include dla.tar application/octet-stream base64]
Then do:
elm -s "tar file" someone@somewhere.com
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 05:15 AM
10-21-2002 05:15 AM
Re: scripting: how to mail an file as attachment on hp-ux
please find attached an example script.
hope this helps!
Regards
Yogeeraj