Duplicating stdout - Microsoft Windows

This is a discussion on Duplicating stdout - Microsoft Windows ; Under Windows XP I'm running an Ant script from a batch file. And what I want is to log the output of the ant script into a file but also to let the messages appear in the console. So what ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Duplicating stdout

  1. Duplicating stdout

    Under Windows XP I'm running an Ant script from a batch file. And what I
    want is to log the output of the ant script into a file but also to let
    the messages appear in the console. So what I need is a duplication of
    stdout and redirection of one copy to a file and of the second copy to
    the stdout.

    I hope you can help me!
    Thanks,
    Vitali

  2. Re: Duplicating stdout

    On Mon, 08 Aug 2005 23:25:58 +0200, Vitali Gontsharuk
    wrote:

    >Under Windows XP I'm running an Ant script from a batch file. And what I
    >want is to log the output of the ant script into a file but also to let
    >the messages appear in the console. So what I need is a duplication of
    >stdout and redirection of one copy to a file and of the second copy to
    >the stdout.


    You want a 'tee' utility ... assuming that the program actually writes
    to the screen through STDOUT. There are several available - I use the
    one in the GnuWin32 'core utilities' package:
    .

    --
    T.E.D. (tdavis@gearbox.maem.umr.edu)

  3. Re: Duplicating stdout

    Ted Davis wrote:

    >On Mon, 08 Aug 2005 23:25:58 +0200, Vitali Gontsharuk
    > wrote:
    >
    >
    >
    >>Under Windows XP I'm running an Ant script from a batch file. And what I
    >>want is to log the output of the ant script into a file but also to let
    >>the messages appear in the console. So what I need is a duplication of
    >>stdout and redirection of one copy to a file and of the second copy to
    >>the stdout.
    >>
    >>

    >
    >You want a 'tee' utility ... assuming that the program actually writes
    >to the screen through STDOUT. There are several available - I use the
    >one in the GnuWin32 'core utilities' package:
    >.
    >
    >
    >

    Thanks for your answer!
    But is there eventually a way to do that with WinXP on-board means? With
    a batch-file with some non-trivial manipulations?

  4. Re: Duplicating stdout

    Vitali Gontsharuk wrote:
    > Ted Davis wrote:



    > >You want a 'tee' utility ... assuming that the program actually writes
    > >to the screen through STDOUT. There are several available - I use the


    > But is there eventually a way to do that with WinXP on-board means? With
    > a batch-file with some non-trivial manipulations?


    You can generate the few processor instructions on the fly:

    :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::
    @echo off
    echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(L...RX2Dx=>dup.com
    echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>dup.com
    echo @VyI?@xAp~sA`LZNxOq@Kt@FB?sUs`LbLB?tgj`{gjB~0x>>dup.com

    dir | dup >dirlist
    del dup.com
    :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::

    :: The source code:
    ::
    ::; 1.7.02 copy stdin to stdout and stderr
    ::
    :: @=$100
    :: move.w #buf,r1
    :: move.w #1,r2
    ::_10: move.b #$3f,m0
    :: eor.w r3,r3
    :: trap #$21
    :: bcs.b _100
    :: cmp.w r0,r2
    :: bne.b _100
    :: move.b #$40,m0
    :: inc.w r3
    :: trap #$21
    :: move.b #$40,m0
    :: inc.w r3
    :: trap #$21
    :: br.b _10
    ::_100: rts.w
    ::buf:

  5. Re: Duplicating stdout

    >
    >>

    >Thanks for your answer!
    >But is there eventually a way to do that with WinXP on-board means? With
    >a batch-file with some non-trivial manipulations?


    Use binaries posted to usenet groups at your own risk. Most computer
    security people will probably tell you that's somewhere between stupid
    and insane, or something to that effect.

    --
    T.E.D. (tdavis@gearbox.maem.umr.edu)
    SPAM filter: Messages to this address *must* contain "T.E.D."
    somewhere in the body or they will be automatically rejected.

  6. Re: Duplicating stdout

    Herbert Kleebauer wrote:

    >Vitali Gontsharuk wrote:
    >
    >
    >>Ted Davis wrote:
    >>
    >>

    >
    >
    >
    >
    >>>You want a 'tee' utility ... assuming that the program actually writes
    >>>to the screen through STDOUT. There are several available - I use the
    >>>
    >>>

    >
    >
    >
    >>But is there eventually a way to do that with WinXP on-board means? With
    >>a batch-file with some non-trivial manipulations?
    >>
    >>

    >
    >You can generate the few processor instructions on the fly:
    >
    >:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::
    >@echo off
    >echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(L...RX2Dx=>dup.com
    >echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>dup.com
    >echo @VyI?@xAp~sA`LZNxOq@Kt@FB?sUs`LbLB?tgj`{gjB~0x>>dup.com
    >
    >dir | dup >dirlist
    >del dup.com
    >:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::
    >
    >:: The source code:
    >::
    >::; 1.7.02 copy stdin to stdout and stderr
    >::
    >:: @=$100
    >:: move.w #buf,r1
    >:: move.w #1,r2
    >::_10: move.b #$3f,m0
    >:: eor.w r3,r3
    >:: trap #$21
    >:: bcs.b _100
    >:: cmp.w r0,r2
    >:: bne.b _100
    >:: move.b #$40,m0
    >:: inc.w r3
    >:: trap #$21
    >:: move.b #$40,m0
    >:: inc.w r3
    >:: trap #$21
    >:: br.b _10
    >::_100: rts.w
    >::buf:
    >
    >

    Wow! That's hardcore But it works fine! Thanks a lot!

  7. Re: Duplicating stdout

    Ted Davis wrote:

    >>
    >>
    >>
    >>Thanks for your answer!
    >>But is there eventually a way to do that with WinXP on-board means? With
    >>a batch-file with some non-trivial manipulations?
    >>
    >>

    >
    >Use binaries posted to usenet groups at your own risk. Most computer
    >security people will probably tell you that's somewhere between stupid
    >and insane, or something to that effect.
    >
    >
    >

    Yes, but once you've tested them - you can use them

  8. Re: Duplicating stdout

    On Tue, 16 Aug 2005 06:00:59 +0200, Vitali Gontsharuk
    wrote:

    >Ted Davis wrote:
    >
    >>>
    >>>
    >>>
    >>>Thanks for your answer!
    >>>But is there eventually a way to do that with WinXP on-board means? With
    >>>a batch-file with some non-trivial manipulations?
    >>>
    >>>

    >>
    >>Use binaries posted to usenet groups at your own risk. Most computer
    >>security people will probably tell you that's somewhere between stupid
    >>and insane, or something to that effect.
    >>
    >>
    >>

    >Yes, but once you've tested them - you can use them


    If you had the expertise to do that safely, I think you would not have
    had to ask the question in the first place.

    --
    T.E.D. (tdavis@gearbox.maem.umr.edu)
    SPAM filter: Messages to this address *must* contain "T.E.D."
    somewhere in the body or they will be automatically rejected.

+ Reply to Thread