Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Creating a file that contains output from a command, and then displays itself Post 302247997 by Annihilannic on Thursday 16th of October 2008 10:09:56 PM
Old 10-16-2008
Not sure I fully understand your requirement, but maybe tee is the command you're looking for? Read the man page and see...
 

10 More Discussions You Might Find Interesting

1. AIX

who -r displays no output

Hello. I have an AIX machine at 6100-00. We had some strange activity since filling up /tmp. One symptom is that who -r displays no output. It doesn't hang just no output is displayed. We are going to boot the machine, but prior to that I'd like to dig a bit to see what may be causing the... (0 Replies)
Discussion started by: maficdan
0 Replies

2. Shell Programming and Scripting

need help with creating dynamic tcl displays

I'm fairly new to tcl scripting and could use a little help. I have a simple list file that will be of unknown size (somewhere between 10 to 20 names). I'd like to create a gui that has a checkbutton for each name in the list and a single action button that will do something for all the checkboxes... (0 Replies)
Discussion started by: scottwevans
0 Replies

3. UNIX for Dummies Questions & Answers

Diff creating special characters in output file

Hi I am comparing 2 files (using diff command) with numerical data in them. In the output file I want only the differences which are in file2 but not in file1. Although I am getting the diffences i am also getting special characters in the output file which i do not want. Can somebody help... (2 Replies)
Discussion started by: ashu_r2001
2 Replies

4. Shell Programming and Scripting

Creating output file using Perl

As an simple example, I have the following files fin1.zv being a one column set of number 1 90 2 80 3 60 4 30 5 20 fin2.zv is another file like this 1 10 20 30 40 50 2 60 70 80 90 0 3 90 80 70 60 50 4 40 30 20 10 0 5 10 20 30 40 50 (2 Replies)
Discussion started by: kristinu
2 Replies

5. Solaris

ls -l displays output with an error

when i use ls command it works normal but when i using additional parameter with ls like ls -l , ls -a... it shows a error followed by the output. # ls -l ./hgfs: Operation not applicable total 12861 -rw-r--r-- 1 root root 0 Jun 1 21:12 1 drwxr-xr-x 2 root root ... (4 Replies)
Discussion started by: chidori
4 Replies

6. Solaris

Last command displays wrong information

Hi am having Solaris10 - Sun-Fire-V890 server, the information displayed by Last command is wrong how do i get this sorted without loosing any datas.. # uptime 12:32am up 20 day(s), 33 min(s), 1 user, load average: 1.54, 1.82, 1.93 # last reboot reboot system boot Sat... (9 Replies)
Discussion started by: Sojourner
9 Replies

7. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

8. Shell Programming and Scripting

Bash $(...) DISPLAYS EVERY COMMAND

I use things like this a lot in ksh and bash, but lately bash has been printing the command for every loop: ... | while read f do if then echo Differ "$f" fi done How to prevent this? (5 Replies)
Discussion started by: DGPickett
5 Replies

9. Shell Programming and Scripting

Script Output Displays Multiple Text

Hello there, I'm using a read-while loop to preserve the word Failed within a text file. For example, if the word Failed exist twice in a single text file, my STDOUT should re-direct to a new text file and display Failed twice. My output is attached to this thread. I would like output to... (4 Replies)
Discussion started by: SysAdminRialto
4 Replies

10. Programming

creating separate output file for each input file in python

Experts, Need your help for this. Please support My motive is to create seperate output file for each Input Files(File 1 and File2) in another folder say(/tmp/finaloutput) Input files File 1(1.1.1.1.csv) a,b,c 43,17104773,3 45,17104234,4 File 2(2.2.2.2.csv) a,b,c 43,17104773,1... (2 Replies)
Discussion started by: as7951
2 Replies
TEE(1P) 						     POSIX Programmer's Manual							   TEE(1P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. 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(1P)
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy