- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Usinge MIME within a PIPE
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
тАО08-11-2010 10:13 AM
тАО08-11-2010 10:13 AM
Re: Usinge MIME within a PIPE
It gets its result into MIME without being an
interactive editor (requiring user action for
proper operation)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2010 02:13 PM
тАО08-11-2010 02:13 PM
Re: Usinge MIME within a PIPE
>be no way to pass some text to the MIME
>program that will wind up in the body of
>the msg. Correct?
Not correct. It does exactly what you want. The /EDIT= command creates the body of the message. The parameter passed to the command is a file name generated by MIME which it uses as the message body.
The procedure in my last reply gives you a 10 point answer. All the mechanisms you need to do precisely what you requested, using PIPE, 100% of the time.
If you're brave, you could also use the final PIPE command to do it in the least amount of code:
PIPE (WO "Line 1" ; WO "Line 2") | (in=F$TRNLNM("SYS$PIPE") ; WO "NEW/EDIT=""COPY ",in,""" mimefile.out" ; WO "ADD attachment" ; WO "SAVE" ; WAIT 00:00:01) | MCR MIME
The body of your message is
Line 1
Line 2
BUT you're depending on the 1 second delay in the second pipe stage to be long enough for the third pipe stage to kick off and start reading from the first stage. It's probably a 99.99% solution, but some day on a very busy system it will fail (I experimented with other mechanisms to synchronise the processes, but couldn't find one).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2010 02:24 PM
тАО08-11-2010 02:24 PM
Re: Usinge MIME within a PIPE
PIPE (-
WO "NEW/EDIT=""PIPE (WO """"Body1"""" ; WO """"Body2"""")|COPY SYS$PIPE"" mimefile.out" ; WO "ADD attachment" ; WO "SA
VE") | MCR MIME
Be careful with quotes!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2010 02:54 PM
тАО08-11-2010 02:54 PM
Re: Usinge MIME within a PIPE
So lets say I have file msg.txt that I want MIME to put into the msg body part of some file. along w/an attached file. What would I use:
$ MIME
MIME> NEW/EDIT=???
MIME> ADD attachement
MIME> SAVE
MIME> EXIT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2010 04:51 PM
тАО08-11-2010 04:51 PM
Solution> I'm just not groking how to use >the /EDIT=dcl function
Yes, MIME has chosen a rather odd way to do the message body. I can see why you might have trouble groking. And I agree, the help text isn't very helpful.
Perhaps this will help...
MIME> NEW myfile
creates "myfile" with MIME headers, yes? The default is /EDIT which invokes a default interactive text editor to create the body text. However, the /EDIT qualifier is more general than that, it can be any command which creates a file. If you type:
MIME> NEW/EDIT="MYCOMMAND" myfile
the MIME command executes your command (presumably with SPAWN), appended with the name of a temporary file. Something like:
$ MYCOMMAND SYS$SCRATCH:MIME$656F_MSG.TXT
Note that the file doesn't exist when the command is invoked. If it exists when the command completes, it will be inserted into the MIME file as the message body. It appears this is the only mechanism for specifying the message body.
So you can see how the default action is really just /EDIT="EDIT/EDT", resulting in:
$ EDIT/EDT SYS$SCRATCH:MIME$656F_MSG.TXT
>So lets say I have file msg.txt that I want
>MIME to put into the msg body
The simplest possibility I can think of is:
MIME> NEW/EDIT="COPY MSG.TXT" mimefile.out
That would be appended with the temp file name and become:
$ COPY MSG.TXT SYS$SCRATCH:MIME$656F_MSG.TXT
MIME would then include the contents of the file into the output file, and delete the temporary file.
I too find this rather odd, it may have made more sense to have /BODY=file, but I suppose the utility was designed to be interactive. It has a kind of "swiss army knife" generality appeal, but it's also a bit klunky.
The variations I've posted are just different ways of feeding some text into some command to generate a file, specified as the last token in the command.
I used two command procedure to investigate what /EDIT was doing:
TEST.COM
$ @TEST1 /OUTPUT=TEST.OUT "''p1'" "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" "''p7'" "''p8'"
$ EXIT
TEST1.COM
$ SHOW SYM p%
$ DIR 'p1'
$ EXIT 1
execute a command:
MIME> NEW/EDIT="@TEST" newfile
and look in TEST.OUT.
(BTW, I believe it's possible to reopen a thread in order to award points... ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2010 12:21 PM
тАО08-12-2010 12:21 PM
Re: Usinge MIME within a PIPE
Last question: how do I reopen this thread so I can add points?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2010 01:01 PM
тАО08-12-2010 01:01 PM
Re: Usinge MIME within a PIPE
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2010 01:57 PM
тАО08-12-2010 01:57 PM
Re: Usinge MIME within a PIPE
- « Previous
-
- 1
- 2
- Next »