- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- elm and uuencode script
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
Discussions
Discussions
Forums
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
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
тАО09-29-2004 11:24 AM
тАО09-29-2004 11:24 AM
any quotes in this message are not part of actual commands, but rather to convey meaning.
I have a canned erp application.
(assume HPLJ printer is set up in UX correctly)
When I set up printers withing the application, we define printer HPLJ and also put in a string "lp -onb -dHPLJ" (with no quotes.
You run a report from erp app and it prints no problem.
Now
I have now set up a printer called EMAIL with a string "elm -s "Report" $LOGNAME
Now the user gets the report in the body of a message via email.
So to me it looks like the erp app is basically adding "< reportdata" when producing output.
What I want to achieve is sending "reportdata" as an attachment.
I know this for sure(file test is text with "hello" in it).
from ux prompt
(uuencode test test.txt) | elm -s test 123@abc.com will send 123@abc.com an email with a subject of test and an attachment of test.txt
So, understanding that the erp app seems to add < "reportdata" to the string i enter.
Is it possible to have a unix script that I could enter into erp app that would take < "reportdata" directed to it and email it to the user as an attachment?
Clear as mud?
Solved! Go to Solution.
- Tags:
- uuencode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2004 11:55 AM
тАО09-29-2004 11:55 AM
Solution# vi /usr/local/bin/email_scr.sh
(
while read INPUT
do
echo $INPUT
done
) >> /tmp/output
ux2dos /tmp/output > /tmp/final
uuencode /tmp/final output.txt | sendmail test123@abc.com
rm /tmp/final /tmp/output
#
In your ERP Application
Define "/usr/local/bin/email_scr.sh" as the string
Above script is not necessarily the best/elegant way to do it, especially if the reportdata is huge in size.
Wait for other suggestions from our forum folks :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2004 07:14 AM
тАО09-30-2004 07:14 AM
Re: elm and uuencode script
When you use elm interactively, it is possible to send an attachment. However when you use elm from command line, this does not work. A solution I can think of is using Expect, which will pretend as if user is interacting with elm even though it is non-interactive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2004 07:29 AM
тАО09-30-2004 07:29 AM
Re: elm and uuencode script
Within the body of your email add this:
------------------------------------
This is my text. How are you?
[include /tmp/myattach application/octet-stream base64]
This is some more text in the middle.
[include /tmp/myexcel.xls application/ms-excel base64]
This is a closing message in the email.
----------------------------------------
That will attach the files "/tmp/myattach" and "/tmp/myexcel.xls" with the text of your message. If the above textfile were /tmp/my.text then you would do this:
cat /tmp/my.txt | elm -s "My Subject" mickeymouse@disney.com
to send your message along the the two files as attachments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2004 10:05 AM
тАО09-30-2004 10:05 AM
Re: elm and uuencode script
Sundar seems to understand and have the best idea so far ..... but I have not tried it yet.
I understand what you are saying Clay, but as I tried to describe, the output is generated by the erp app and files do not exist on disk(except as they are spooling), so there is no editing of files.
I have tried to describe it as best as I can and I think the solution is going to be along the lines of what Sundar is suggesting.
Clay, could you give my origional post another read over.
All I have to work with is a script that has < "erp generated report" directed to it.
script.sh < "erp generated report"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2004 11:54 AM
тАО09-30-2004 11:54 AM
Re: elm and uuencode script
Let me see if I understood your message.
Put the following line in a script say 'mailer.sh'
uuencode your_report |mailx -m -s "reportdata" Yourid@yourdomain.com
If you run the command
mailer.sh < reportdata
You should get reportdata as an attachment called "your_report" with the subject "reportdata".
-m is important otherwise you will get the whole thing as a body.
-Sri