User Tools

Site Tools


bash:redirection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
bash:redirection [2019/12/14 19:56] peterbash:redirection [2021/01/13 21:51] (current) – [BASH - Redirection] peter
Line 6: Line 6:
  
   * Your screen has a File Descriptor.  When a program is executed the output is sent to File Descriptor of the screen, and you see program output on your monitor.   * Your screen has a File Descriptor.  When a program is executed the output is sent to File Descriptor of the screen, and you see program output on your monitor.
- 
   * Your printer has a File Descriptor.  If the output is sent to File Descriptor of the printer, the program output would be printed.   * Your printer has a File Descriptor.  If the output is sent to File Descriptor of the printer, the program output would be printed.
  
 +----
  
 ===== Standard File Descriptors ===== ===== Standard File Descriptors =====
Line 82: Line 82:
  
 ===== Error Redirection ===== ===== Error Redirection =====
- 
- 
-As explained before a file descriptor, is associated with each of these files: 
- 
-^File^File Descriptor^ 
-|Standard Input STDIN|0| 
-|Standard Output STDOUT|1| 
-|Standard Error STDERR|2| 
- 
-By default, error stream is displayed on the screen. 
- 
-Error redirection is routing the errors to a file other than the screen. 
- 
-==== Why Error Redirection? ==== 
  
 Error re-direction is one of the very popular features of Unix/Linux. Error re-direction is one of the very popular features of Unix/Linux.
Line 106: Line 92:
 The solution is to re-direct the error messages to a file. The solution is to re-direct the error messages to a file.
  
-=== Example 1 ===+==== Example 1 ====
  
 <code bash> <code bash>
Line 122: Line 108:
 ---- ----
  
-=== Example 2 === +==== Example 2 ====
- +
-Here is another example which uses find statement -+
  
 <code bash> <code bash>
bash/redirection.1576353376.txt.gz · Last modified: 2020/07/15 10:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki