HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Help needed for Small Script.
Operating System - HP-UX
1834926
Members
2559
Online
110071
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
05-15-2002 09:44 AM
05-15-2002 09:44 AM
Hello all,
I was wondering if you can help me with my little script. The purpose of the script is to send me an email with every text file that contains more than 1 line as a seperate attachement. Here is my code.
**************************************
#/bin/sh
ls *.txt | while read FILE
do
NL=`wc -l $FILE | awk '{print $1}'`
if [ $NL -gt 1 ]; then
ls $FILE | awk '{ system ("ux2dos " $1 " | uuencode " $1 " | /usr/lib/sendmail" )}'
fi
done
***************************************************
The problem with that script, is that it sends an email per file. (of course).
I was wondering if you can tell me a way to send 1 email with all txt files as seperate attachements sent.
Thanks
I was wondering if you can help me with my little script. The purpose of the script is to send me an email with every text file that contains more than 1 line as a seperate attachement. Here is my code.
**************************************
#/bin/sh
ls *.txt | while read FILE
do
NL=`wc -l $FILE | awk '{print $1}'`
if [ $NL -gt 1 ]; then
ls $FILE | awk '{ system ("ux2dos " $1 " | uuencode " $1 " | /usr/lib/sendmail
fi
done
***************************************************
The problem with that script, is that it sends an email per file. (of course).
I was wondering if you can tell me a way to send 1 email with all txt files as seperate attachements sent.
Thanks
If you don't have what you want, want what you have.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2002 09:49 AM
05-15-2002 09:49 AM
Re: Help needed for Small Script.
First create a file with the following line-
[include test1.txt application/text base64]
[include test2.txt application/text base64]
Second from the command line:
elm -s "your subject" user@yoursite.com
Where "file" contains the necessary [include] lines.
-- Rod Hills
[include test1.txt application/text base64]
[include test2.txt application/text base64]
Second from the command line:
elm -s "your subject" user@yoursite.com
Where "file" contains the necessary [include] lines.
-- Rod Hills
There be dragons...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2002 10:55 AM
05-15-2002 10:55 AM
Re: Help needed for Small Script.
The suggestion you have works fine. The only problem is that I don't exactly know how to fix the command ux2dos and/or uuencode so that the txt files sent through email are readable. can you help ?
If you don't have what you want, want what you have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2002 12:42 PM
05-15-2002 12:42 PM
Solution
You shouldn't have to worry about using encode on the text (the base64 takes care of that).
The ux2dos will need to be run. So just copy each file to /tmp and email the converted files.
Here is your script updated-
#/bin/sh
cat /tmp/listfiles
ls *.txt | while read FILE
do
NL=`wc -l $FILE | awk '{print $1}'`
if [ $NL -gt 1 ]; then
ux2dos <$FILE >/tmp/${FILE}crlf
echo "[include /tmp/${FILE}crlf application/text base64]" >>/tmp/listfiles
fi
done
elm -s "Here are your files" user@yoursite.com rm /tmp/listfiles
rm /tmp/*crlj
-- Rod Hills
The ux2dos will need to be run. So just copy each file to /tmp and email the converted files.
Here is your script updated-
#/bin/sh
cat /tmp/listfiles
ls *.txt | while read FILE
do
NL=`wc -l $FILE | awk '{print $1}'`
if [ $NL -gt 1 ]; then
ux2dos <$FILE >/tmp/${FILE}crlf
echo "[include /tmp/${FILE}crlf application/text base64]" >>/tmp/listfiles
fi
done
elm -s "Here are your files" user@yoursite.com rm /tmp/listfiles
rm /tmp/*crlj
-- Rod Hills
There be dragons...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP