🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.msdos.programmer
1 messages
1 total messages Started by Floyd Miller Fri, 02 Mar 1990 22:57
Redirecting output of DOS batch files
#1296
Author: Floyd Miller
Date: Fri, 02 Mar 1990 22:57
38 lines
1767 bytes
I have a few batch files that run pipelined programs,
searching for a pattern, extracting fields and sorting.
They make life a bit easier by elliminating the need
to retype long command lines.

However, sometimes I want to run the final output through
a pager (like "more") or save the results in a file.
I try to run:  filter.bat | more
More doesn't do anything.
So I try:      filter.bat > f.out
f.out gets created with no data while the output
of filter.bat comes pouring out on my screen.

Apparently, REDIRECTING DOESN'T WORK ON BATCH FILES.

I was surprised mostly by the fact that it took up until
now for me to discover this deficiency in DOS.

I think that a program which overlays stderr onto stdout
and then invokes the batch file would allow redirection
of the batch file output.  Then you would run the batch
file as:

       redir prog.bat
  or   redir prog.bat > file.out
  or   redir prog.bat | more

I will try this.  And, if there is interest I'll post
"redir" if it works.  But is there an easier way?
Perhaps without having to use a separate program to
invoke the batch file?

*******   *****************************************
*****  ************************* Floyd Miller
***  *************** floyd@starsend.UUCP
*  ********* floyd%starsend@PRC.Unisys.com
  *** starsend!floyd@burdvax.PRC.Unisys.com
*
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads