Article View: alt.msdos.programmer
Article #1152Re: Redirection of STDERR ??
From: Ed Schwartz
Date: Thu, 16 Nov 1995 12:12
Date: Thu, 16 Nov 1995 12:12
48 lines
2032 bytes
2032 bytes
In article <DI3BnA.JF5@news.zippo.com>, from Wed, 15 Nov 1995 15:16:38 GMT
Fred Frot at Fred.Dullemond@Austria.ATTGIS.COM says...
>
>
>Hello,
>
>At the moment I am developing some kind of tool to call (spawn/exec)
>other commands (using swap of memory) in MS-DOS.
>
>In order not to disturb the screen by messages from the called program
>I use redirection of stdout.
>
> e.g. 'dir > \it.txt'
>
>I encountered a problem when this called program writes something to
>stderr. These messages are not redirected to the file, but corrupt the
>screen display and confuse the ignorant user.
>
>So I want to do something like under UNIX command-line :
>
> ls > /dev/null 2>&1
>
>or redirecting the stderr in the calling program to stdout (which I
>think would be the best), but I don't know how to do this.
>
Seems you want to redirect *all* output from the called command ?
Instead of calling the command directly, enclose the command
in a batch file:
@echo off
ctty nul
command-to-call
ctty con
and then call COMMAND.COM /C d:\path\that_batch.bat
--
Ed Schwartz
+------- e-mail --------------+--- s-mail ----+---- Phone/Fax ---------+
| schwartz@sunco.co.kp.dlr.de | DLR/RM-CTC | Tel.: (0)2203-601 2648 |
| Edwin.Schwartz@dlr.de | Linder Hoehe | Fax : (0)2203-601 2701 |
| | D-51147 Koeln | |
| http://www.dlr.de | Germany | |
+-----------------------------+---------------+------------------------+
Technical Details
Message-ID:
<DI4xxJ.CF7@news.dlr.de>Path:
arc1-ca.pugleaf.net!news.dlr.de!newsReferences:
<DI3BnA.JF5@news.zippo.com>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer,comp.lang.c,comp.msdos.programmer,comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!news.dlr.de!news From: schwartz@sunco.co.kp.dlr.de (Ed Schwartz) Subject: Re: Redirection of STDERR ?? X-Nntp-Posting-Host: pcshwa.co.kp.dlr.de Message-ID: <DI4xxJ.CF7@news.dlr.de> Sender: news@news.dlr.de Organization: DLR / RM-CTC X-Newsreader: WinVN 0.99.5 References: <DI3BnA.JF5@news.zippo.com> Date: Thu, 16 Nov 1995 12:12:54 GMT