Skip to content

            Lost ?  |  Need an account:
 
Stream Redirection PDF Print E-mail
(2 votes, average 5.00 out of 5)
Written by Tom Hirt   
Tuesday, 24 February 2009 13:06
Article Index
Stream Redirection
Standard Input
Standard Output
Standard Error
Combined Output
All Pages

Stream Redirection


Under normal circumstances every Unix program has three streams opened for it when it starts up, one for input, one for output, and one for printing diagnostic or error messages. These are typically attached to the user's terminal (see tty(4)) but might instead refer to files or other devices, depending on what the parent process chose to set up.

-Taken from  the BSD Library Functions Manual for STDIN(3)

The input stream is referred to as Standard Input or stdin, the ouput stream as Standard Output or stdout and the Error stream as Standard Error or stderr.  As a systems admins, we often have need for input/output redirection, to many reasons for which to discuss within the context of this article.  However, we will highlight a few real-world use-cases for input/output redirection to which you'll be able to reference as a guide within the context of your own environment for further use.

Input / Output Definitions
stdin from file
0<
stdin with delimiter 0<<
stdout overwrite file
1>
stdout append file 1>>
stderr overwrite file
2>
stderr append file 2>>


Comments
Add New Search
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry::evil::twisted::roll::wink::!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Monday, 02 March 2009 15:57
 

Forum Activity

Author:
Author: kenny22
Jan.24.12
Author: AaronRiley
Jan.15.12

Online Stats

Guests Online: 81
Members Online: 0