Hi,

On Sun, Nov 28, 2021 at 6:53 AM saito yutaka <melody....@gmail.com> wrote:
>
> How to redirect STDOUT and STDERR to file.
> I want to redirect to file as follow.
>
> ---
> c:\>dir aaa > out.txt
> c:\> type out.txt
>  Volume in drive C is FREEDOS2021
>  Volume Serial Number is 3668-1A1E
> File not found.
> ---
>
> But it works as follow.
> It couldn't redirect "File not found" string.
>
> ---
> c:\>dir aaa > out.txt
> File not found.
> c:\> type out.txt
>  Volume in drive C is FREEDOS2021
>  Volume Serial Number is 3668-1A1E
> ---

As mentioned, some things won't work by default.

For most things, if you just want to silence output (usually in a .BAT
file), try this:

REM ... shut up almost all output ...
ctty nul
echo (do whatever)
ctty con
REM ... make sure to re-enable "ctty con" at the end!! ...

To redirect STDERR to file, you need a third-party util (or a better
shell like 4DOS, as already mentioned):

* http://cd.textfiles.com/simtel/simtel0101/simtel/asmutl/stderrf1.zip

There's also DJGPP's REDIR.EXE (386 DPMI) from DJDEV205.ZIP :

* http://www.delorie.com/pub/djgpp/current/v2/djdev205.zip


_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to