error output

error output

Post by Dima Petro » Mon, 05 Jan 2004 08:04:50


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
 
 
 

error output

Post by roberso » Mon, 05 Jan 2004 08:32:34

In article < XXXX@XXXXX.COM >,

: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.

 
 
 

error output

Post by SkyWrite » Mon, 05 Jan 2004 09:02:26


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

http://www.yqcomputer.com/

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

error output

Post by Dima Petro » Thu, 08 Jan 2004 19:46:36


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
 
 
 

error output

Post by Ralf Fasse » Thu, 08 Jan 2004 20:43:58

* Dima Petroff < XXXX@XXXXX.COM >
| 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.
--<snip-snip>--
> >! >& >&!
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'