trying to redirect both std out and err to a file together and still err to a separate file

Discussion in 'Java' started by qwertmonkey@syberianoutpost.ru, Aug 29, 2012.

  1. Guest

    Lew you are right the thread started on comp.unix.shell. It does however
    related to java.
    ~
    The thing is that sometimes I would (within java) redirect out and/or err
    to files but sometimes I need for out and err to log to the same file and err
    still to a different/separate one. I haven't figured out how to do that
    cleanly/easily in java.
    ~
    The shell, however, seems to come handy in such cases. In fact as I found out,
    things aren't that simple on the shell either (comp.unix.shell: Lem Novantotto ...),
    so it is best if those guys sort it out themselves
    ~
    lbrtchx
    comp.lang.java.programmer: trying to redirect both std out and err to a file
    together and still err to a separate file
     
    , Aug 29, 2012
    #1
    1. Advertisements

  2. Roedy Green

    Roedy Green Guest

    On Wed, 29 Aug 2012 02:58:45 +0000 (UTC),
    wrote, quoted or indirectly quoted
    someone who said :

    > Lew you are right the thread started on comp.unix.shell. It does however
    >related to java


    If you do it with a shell, you potentially need a different script for
    each platform. If you do it inside the Java program, it works
    everywhere. However, it is usually easier to modify a shell than a
    Java program.

    see System.setErr System.setOut
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    A new scientific truth does not triumph by convincing its opponents and making them see the light,
    but rather because its opponents eventually die, and a new generation grows up that is familiar with it.
    ~ Max Planck 1858-04-23 1947-10-04
     
    Roedy Green, Aug 29, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. EvgueniB
    Replies:
    1
    Views:
    841
    Anthony Borla
    Dec 15, 2003
  2. steve
    Replies:
    2
    Views:
    828
    steve
    Dec 12, 2004
  3. Replies:
    2
    Views:
    756
    hurcan solter
    Aug 15, 2007
  4. Will Lichtenberger
    Replies:
    3
    Views:
    3,770
    dener
    Nov 5, 2008
  5. Ara.T.Howard

    thread local $std(in|out|err)

    Ara.T.Howard, Sep 29, 2005, in forum: Ruby
    Replies:
    0
    Views:
    160
    Ara.T.Howard
    Sep 29, 2005
  6. Terry Cooper
    Replies:
    7
    Views:
    586
    Janos Sebok
    Jun 9, 2009
  7. Replies:
    1
    Views:
    711
  8. Replies:
    0
    Views:
    475
Loading...