Still no luck. I tried doing the "open OUTPUT, "pipe some_command 2>&1 |";
method but i am getting funny outputs back.. in my case, some_command is
actually a cvs command... specifically open OUTPUT, "cvs diff --brief -l -r
prdsr021212 2>&1 |", etc...
For example, the correct output with some debugging messges (first diff:
shows the output it receives from the first cvs command, second diff: shows
the output it receives from the second cvs command) that I have put is (this
was run on UNIX):
pli@gamra:/home/pli/ming$ perl promote3
Please enter the Change Request # you are promoting files for: 1234
Gathering file information in current directory. Please wait...
Hit Ctrl-C to abort.
fileF has not been checked in and cannot be promoted at this time.
cvs diff --brief -l -r prdsr021212 2>&1 |
first diff: ? log
first diff: ? logs
first diff: ? pl
first diff: ? promote2
first diff: ? promote3
first diff: ? test.pl
first diff: cvs server: Diffing .
first diff: cvs server: tag prdsr021212 is not in file aksdf
first diff: cvs server: tag prdsr021212 is not in file fileE
first diff: cvs server: tag prdsr021212 is not in file fileF
first diff: cvs server: tag prdsr021212 is not in file newFile
first diff: cvs server: tag prdsr021212 is not in file testpat
first diff: cvs server: tag prdsr021212 is not in file testpat2
cvs diff --brief -l -r dev_gold_1234 2>&1 |
2nd diff: ? log
2nd diff: ? logs
2nd diff: ? pl
2nd diff: ? promote2
2nd diff: ? promote3
2nd diff: ? test.pl
2nd diff: cvs server: Diffing .
2nd diff: cvs server: tag dev_gold_1234 is not in file aksdf
2nd diff: cvs server: fileC no longer exists, no comparison available
2nd diff: cvs server: fileD no longer exists, no comparison available
2nd diff: cvs server: tag dev_gold_1234 is not in file fileE
2nd diff: Index: fileF
2nd diff:
===================================================================
2nd diff: RCS file: /etrade/cvsserver/cvs/ming/fileF,v
2nd diff: cvs server: fileH no longer exists, no comparison available
2nd diff: cvs server: fileI no longer exists, no comparison available
2nd diff: cvs server: fileK no longer exists, no comparison available
2nd diff: cvs server: fileL no longer exists, no comparison available
2nd diff: cvs server: tag dev_gold_1234 is not in file newFile
2nd diff: cvs server: tag dev_gold_1234 is not in file testpat
2nd diff: cvs server: tag dev_gold_1234 is not in file testpat2
when running the same script on VMS however, i get this:
$ perl promote3
Please enter the Change Request # you are promoting files for: 12345
Gathering file information in current directory. Please wait...
Hit Ctrl-C to abort.
pipe cvs diff --brief -l -r prdsr021212 2>&1 |
first diff: ?
first diff:
first diff: ?
first diff:
first diff: ? 1
first diff:
first diff: ? .1
first diff:
first diff: ? .1
first diff:
first diff: ? .1
first diff:
first diff: ?
first diff:
first diff: ?
first diff:
first diff: ?
first diff:
first diff: ?
first diff:
first diff: ?
first diff:
first diff: ?
first diff:
pipe cvs diff --brief -l -r dev_gold_12345 2>&1 |
2nd diff: ?
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: ? 1
2nd diff:
2nd diff: ? .1
2nd diff:
2nd diff: ? .1
2nd diff:
2nd diff: ? .1
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: ?
2nd diff:
2nd diff: Index: newFile
2nd diff:
2nd diff:
===================================================================
2nd diff:
2nd diff: RCS file: /etrade/cvsserver/cvs/ming/newFile,v
2nd diff:
2nd diff: diff --brief -r1.1 -r1.2
2nd diff:
2nd diff: Files /tmp/cvs08V9qV and /tmp/cvs0gp3qQ differ
2nd diff:
I am very confused by why it outputs those senseless lines when those
commands are run on VMS... any ideas guys?
Thank you so much. I think we're close to figuring out how to get it
working here...
Patrick
-----Original Message-----
From: Craig A. Berry [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 5:41 PM
To: Thomas R Wyant_III
Cc: '[EMAIL PROTECTED]'
Subject: Re: redirecting STDERR to STDOUT inside a program
At 2:14 PM -0500 1/6/03, Thomas R Wyant_III wrote:
>VMS is not Unix, but you _may_ be able to get your Unix syntax to work if
>you hold your tongue correctly.
>
>At some point in the history of VMS, a command called "pipe" was
>introduced, which appears to implement a lot of Unix I/O redirection
>functionality, including pipes and ">" redirection. So
>
>open OUTPUT, "pipe some_command 2>&1 |";
>
>may do what you want.
Yes, it may. If "some_command" happens to be Perl, skip the
preceding "pipe" since Perl has its own redirection capabilities and
has had them since before DCL (the VMS shell) implemented them.
>Or it may not. One thing to beware of is that VMS doesn't really have
>pipes; instead it has something called (confusingly) mailboxes.
This is not something Patrick needs to know to get started, but it
may be worth mentioning the full story here. Perl's pipes on VMS
(since 5.6.1 and later) are implemented with mailboxes. My
understanding is that the C run-time also uses mailboxes internally
for its pipe implementation (popen, system, and such), but we had so
much trouble with hangs and deadlocks using the C RTL that we (well,
Chuck Lane, actually) developed a piping implementation especially
for Perl. DCL's pipes, on the other hand, use a made-for-DCL pipe
driver that does many of the same things but apparently not all of
the things the C RTL would need. The pipe driver is not documented
and probably not callable from user mode code, so it really wasn't an
option when Chuck cooked up his own pipe implementation.
> Most VMS commands (but not all,
>unfortunately!) have a /OUTPUT= qualifier to send the output to a file. If
>the command you want doesn't have this, you can issue the commands
>$ assign/user_mode output_file.dat sys$output
>$ assign/user_mode output_file.dat sys$error
>$ some_command
>All three of the above MUST BE ISSUED IN THE SAME PROCESS. So you'll have
>to write them all to a scratch file, and then execute that file as a
>command procedure.
In some cases one also needs to turn off messages. See the help topic
SET MESSAGE.
Now, tell us how badly we've confused you and how far you've gotten
with our advice.
--
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser