Sponsored Content
Full Discussion: 'tee' STDERR output (ksh)
Top Forums Shell Programming and Scripting 'tee' STDERR output (ksh) Post 26562 by Optimus_P on Tuesday 20th of August 2002 03:37:48 PM
Old 08-20-2002
Code:
DESCRIPTION
     The tee utility will copy standard input to standard output,
     making a copy in zero or more files. tee will not buffer its
     output. The options determine if  the  specified  files  are
     overwritten or appended to.

so possably something such as this is what might do it for ya.

"your_command_here 2>&1 |tee -a stdout.log" its worth a shot.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to subtract 2 hours from 'date' in shell ( /bin/sh ) script ?

I write a sh script that zip and copy to tape all files that older then 2 hours. 1. The way I choose is - touch a file with "now - 2 hours", then use fine with '! -newer' 2. Do you have any other idea to do it ? tnx. (1 Reply)
Discussion started by: yairon
1 Replies

2. Programming

i can't use 'make' in my computer?

I need to compile a file,but 'make' does not work.please tell me how to use it or need which tools? (3 Replies)
Discussion started by: dsun5
3 Replies

3. Shell Programming and Scripting

Clearify what it means under 'WHAT' when hit the 'w'-command

I wonder how I shall read the result below, especially 'what' shown below. The result was shown when I entered 'w'. E.g what is TOP? What is gosh ( what does selmgr mean?)? login@ idle JCPU PCPU what 6:15am 7:04 39 39 TOP 6:34am 6:45 45 45 TOP 6:41am ... (1 Reply)
Discussion started by: Aelgen
1 Replies

4. UNIX for Dummies Questions & Answers

Further question on 'ifconfig' output

I asked a similar question earlier and got a very good answer but a new doubt came up. This is a few lines of a '/sbin/ifconfig' command on my PC: RX packets:3781025 errors:0 dropped:0 overruns:0 frame:0 TX packets:1941909 errors:0 dropped:0 overruns:0 carrier:0 Does the RX and TX packets... (1 Reply)
Discussion started by: mint1981
1 Replies

5. Filesystems, Disks and Memory

HELP! The '/var/adm/message' file increase every few seconds???

Hi, guys, I have a big problem. I've got a sun solaris 4.1.4 workstation, and the /var/adm/message file will add one row every few seconds. It soon becomes a large file. I wander if there are some mistakes configuring the workstation. the /var/adm/message is as follow: ... (1 Reply)
Discussion started by: cloudsmell
1 Replies

6. UNIX for Dummies Questions & Answers

HELP! The '/var/adm/message' file increase every few seconds???

Hi, guys, I have a big problem. I've got a sun solaris 4.1.4 workstation, and the /var/adm/message file will add one row every few seconds. It becomes a large file in a short time. I wander if there are some mistakes configuring the workstation. the /var/adm/message is as follow: ... (3 Replies)
Discussion started by: cloudsmell
3 Replies

7. UNIX for Dummies Questions & Answers

quoting echo 'it's friday'

echo 'it's friday' why appear the > (3 Replies)
Discussion started by: yls177
3 Replies

8. Email Antispam Techniques and Email Filtering

Procmail recipe: blocking 'unsubscribe and opt-out' messages....

Here is a crude procmail recipe that I quickly created (NOT a procmail recipe expert, btw) that has been catching lots of spam (current second after the charset_spam recipe posted earlier): :0B * .*If.you.do.not.wish.to.receive...* more_spam :0B * You.requested.to.receive.this.mailing... (0 Replies)
Discussion started by: Neo
0 Replies

9. UNIX for Advanced & Expert Users

How to remove a file with a leading dash '-' in it's name?

Somehow someone created a file named '-ov' in the root directory. Given the name, the how was probably the result of some cpio command they bozo'ed. I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies

10. Shell Programming and Scripting

What are the differences between 'bash' and 'sh'

Hopefully this doesn't come off as too much of a "newbie" question or a flamebait. But I have recently begun working with a Sun Solaris box after having spent the past five years working with RedHat. From what i can tell, thing look fairly similar and the 'man' command is some help. But I've... (7 Replies)
Discussion started by: deckard
7 Replies
TEE(P)							     POSIX Programmer's Manual							    TEE(P)

NAME
tee - duplicate standard input SYNOPSIS
tee [-ai][file...] DESCRIPTION
The tee utility shall copy standard input to standard output, making a copy in zero or more files. The tee utility shall not buffer output. If the -a option is not specified, output files shall be written (see File Read, Write, and Creation . OPTIONS
The tee utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines. The following options shall be supported: -a Append the output to the files. -i Ignore the SIGINT signal. OPERANDS
The following operands shall be supported: file A pathname of an output file. Processing of at least 13 file operands shall be supported. STDIN
The standard input can be of any type. INPUT FILES
None. ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of tee: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES . ASYNCHRONOUS EVENTS
Default, except that if the -i option was specified, SIGINT shall be ignored. STDOUT
The standard output shall be a copy of the standard input. STDERR
The standard error shall be used only for diagnostic messages. OUTPUT FILES
If any file operands are specified, the standard input shall be copied to each named file. EXTENDED DESCRIPTION
None. EXIT STATUS
The following exit values shall be returned: 0 The standard input was successfully copied to all output files. >0 An error occurred. CONSEQUENCES OF ERRORS
If a write to any successfully opened file operand fails, writes to other successfully opened file operands and standard output shall con- tinue, but the exit status shall be non-zero. Otherwise, the default actions specified in Utility Description Defaults apply. The following sections are informative. APPLICATION USAGE
The tee utility is usually used in a pipeline, to make a copy of the output of some utility. The file operand is technically optional, but tee is no more useful than cat when none is specified. EXAMPLES
Save an unsorted intermediate form of the data in a pipeline: ... | tee unsorted | sort > sorted RATIONALE
The buffering requirement means that tee is not allowed to use ISO C standard fully buffered or line-buffered writes. It does not mean that tee has to do 1-byte reads followed by 1-byte writes. It should be noted that early versions of BSD ignore any invalid options and accept a single '-' as an alternative to -i. They also print a message if unable to open a file: "tee: cannot access %s ", <pathname> Historical implementations ignore write errors. This is explicitly not permitted by this volume of IEEE Std 1003.1-2001. Some historical implementations use O_APPEND when providing append mode; others use the lseek() function to seek to the end-of-file after opening the file without O_APPEND. This volume of IEEE Std 1003.1-2001 requires functionality equivalent to using O_APPEND; see File Read, Write, and Creation . FUTURE DIRECTIONS
None. SEE ALSO
Introduction , cat , the System Interfaces volume of IEEE Std 1003.1-2001, lseek() COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 TEE(P)
All times are GMT -4. The time now is 09:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy