1752608 Members
4422 Online
108788 Solutions
New Discussion юеВ

redirect sys$output

 
YE LIU_1
Frequent Advisor

redirect sys$output

Dear VMS Users,

I want to do this in VMS: put the output of this command to fileA_diff file. How to achive that?

difference fileA,c fileA_new.c

Thanks,

YE LIU
3 REPLIES 3
John Gillings
Honored Contributor

Re: redirect sys$output

YE,

There are lots of ways to redirect output. For many commands there is a /OUTPUT qualifier to direct output to a file. DIFFERENCE has one, so the simplest answer is:

$ DIFFERENCE/OUTPUT=fileA_diff fileA.c fileA_new.c

For commands that don't have a /OUTPUT qualifier, try:

$ DEFINE/USER SYS$OUTPUT output_file.txt
$ command

or

$ PIPE command > output_file.txt

or (if you want to capture the output of several commands)

$ @TT/OUTPUT=output_file.txt
_$ command
_$ another command
_$ etc...
_$ EXIT
$ TYPE output_file.txt

A crucible of informative mistakes
Hoff
Honored Contributor

Re: redirect sys$output

Redirection is a Unix solution, and doesn't work quite the same (or quite as well) on OpenVMS. And it doesn't necessarily lend itself quite as well to Unix-style solutions.

Redirection or the parsing of command output is often not a good solution, though (as mentioned in the previous reply) it is often feasible. Its not good because the formats of the commands can potentially change.

For the DCL command verb in this case, and many others, the command has an /OUTPUT qualifier. DIFFERENCES /OUTPUT. As was mentioned. HELP DIFFERENCES can provide you with substantial information, and most DCL verbs have on-line help text at least on par with and sometimes rather better than man pages.

I'd suggest a quick tour through the OpenVMS User's Guide, as that can provide some insight into how OpenVMS and DCL works.

So what are you up to here with the DIFFERENCES command itself?
YE LIU_1
Frequent Advisor

Re: redirect sys$output

thanks