error output - SGI

This is a discussion on error output - SGI ; Hi All, System: IRIX (SGI Octane2) Place: IRIX Console Question: How to make an error command output into the file? The Linux trick doesn't work. #anycommand 2>&1 |tee filename.txt I need to get error messages from command line into the ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: error output

  1. error output

    Hi All,

    System: IRIX (SGI Octane2)
    Place: IRIX Console
    Question: How to make an error command output into the file?
    The Linux trick doesn't work.

    #anycommand 2>&1 |tee filename.txt

    I need to get error messages from command line into the TXT files
    for farther analyzing.

    Thanks in advance,
    --
    Dimitri

  2. Re: error output

    In article ,
    Dima Petroff wrote:
    :System: IRIX (SGI Octane2)
    :Place: IRIX Console
    :Question: How to make an error command output into the file?
    :The Linux trick doesn't work.

    :#anycommand 2>&1 |tee filename.txt

    :I need to get error messages from command line into the TXT files
    :for farther analyzing.

    If the '#' indicates a 'sh' or 'ksh' prompt, then that should
    work. Some systems, though, use csh as the root shell.

    If you are not executing as root, then your shell is probably csh
    instead of sh or ksh.

    You should be able to check your shell by commanding

    echo $SHELL

    If it is csh then my recommandation would be to change
    your shell. (Yeah, you could look up the syntax in the csh
    man page, but at the end of that you'd still be in csh )
    --
    Oh, yeah, an African swallow maybe, but not a European swallow.
    That's my point.

  3. Re: error output

    Walter Roberson wrote:

    > In article ,
    > Dima Petroff wrote:
    > :System: IRIX (SGI Octane2)
    > :Place: IRIX Console
    > :Question: How to make an error command output into the file?
    > :The Linux trick doesn't work.
    >
    > :#anycommand 2>&1 |tee filename.txt
    >
    > :I need to get error messages from command line into the TXT files
    > :for farther analyzing.
    >
    > If the '#' indicates a 'sh' or 'ksh' prompt, then that should
    > work. Some systems, though, use csh as the root shell.
    >
    > If you are not executing as root, then your shell is probably csh
    > instead of sh or ksh.
    >
    > You should be able to check your shell by commanding
    >
    > echo $SHELL
    >
    > If it is csh then my recommandation would be to change
    > your shell. (Yeah, you could look up the syntax in the csh
    > man page, but at the end of that you'd still be in csh )
    > --
    > Oh, yeah, an African swallow maybe, but not a European swallow.
    > That's my point.


    conversely, you could download and install the bash shell, and have
    all the linux tricks you want (and you know you want to!).

    http://freeware.sgi.com/index-by-alpha.html

    how to do that is of course, beyond the scope of this usenet post.



  4. Re: error output

    On 2004-01-04, SkyWriter wrote:
    > conversely, you could download and install the bash shell, and have
    > all the linux tricks you want (and you know you want to!).
    >
    > http://freeware.sgi.com/index-by-alpha.html
    >
    > how to do that is of course, beyond the scope of this usenet post.


    Thanks for your replyes. Yes, you were right, it is 'csh'. The one way
    is to install the bash shell via inst command. But I'm not familiar
    with IRIX yet and this is a work station with Discreet software. I scare
    to kill the system.

    Is there any command for 'csh' to do the same result?

    --
    Dimitri

  5. Re: error output

    On Wed, 7 Jan 2004 10:46:36 +0000 (UTC), Dima Petroff wrote:

    >On 2004-01-04, SkyWriter wrote:
    >> conversely, you could download and install the bash shell, and have
    >> all the linux tricks you want (and you know you want to!).
    >>
    >> http://freeware.sgi.com/index-by-alpha.html
    >>
    >> how to do that is of course, beyond the scope of this usenet post.

    >
    >Thanks for your replyes. Yes, you were right, it is 'csh'. The one way
    >is to install the bash shell via inst command. But I'm not familiar
    >with IRIX yet and this is a work station with Discreet software. I scare
    >to kill the system.
    >
    >Is there any command for 'csh' to do the same result?


    Yes, but not for error alone:

    For csh:

    command > log.out (standard output )
    command >& log.out (standard & error output)

    Or for sh / ksh:

    command 1> log.out (standard output)
    command 2> log.out (error output)
    command 1> log.out 2>&1 (standard & error output)

    You can see why sh / ksh is much prefered



  6. Re: error output

    * Dima Petroff
    | Is there any command for 'csh' to do the same result?

    man csh:
    A simple command, or a set of simple commands separated by | or
    |& characters, forms a pipeline. With |, the standard output of
    the preceding command is redirected to the standard input of the
    ! command that follows. With |&, both the standard error and the
    standard output are redirected through the pipeline.
    ----
    > >! >& >&!

    Redirect the standard output to a file. If the file does not exist,
    it is created. If it does exist, it is overwritten; its previous
    contents are lost.

    When set, the variable noclobber prevents destruction of existing
    files. It also prevents redirection to terminals and /dev/null,
    ! unless one of the ! forms is used. The & forms redirect both standard
    output and the standard error (diagnostic output) to the file.

    However, you can't easily redirect stdout and stderr to _separate_
    destinations in csh.

    HTH
    R'

+ Reply to Thread