User Tools

Site Tools


bash:output

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:output [2021/01/26 15:16] peterbash:output [2021/01/26 16:26] (current) peter
Line 4: Line 4:
  
 [[BASH:Output:Check Exit Status|Check Exit Status]] [[BASH:Output:Check Exit Status|Check Exit Status]]
 +
 +[[BASH:Output:Display output|Display output]]
  
 [[BASH:Output:Get the output of a command|Get the output of a command]] [[BASH:Output:Get the output of a command|Get the output of a command]]
 +
 +[[BASH:Output:Troubleshooting|Troubleshooting]]
  
 [[BASH:Output:Understand the difference between standard output and standard error|Understand the difference between standard output and standard error]] [[BASH:Output:Understand the difference between standard output and standard error|Understand the difference between standard output and standard error]]
  
- +[[BASH:Output:Redirect Output To FileAnd Still Have It On Screen|Redirect Output To FileAnd Still Have It On Screen]]
- +
- +
----- +
- +
- +
-===== Badly-written commands ===== +
- +
-Some commands are not well-written, however, and may write information to the wrong place.  You must keep an eye out for such commands, and work around them when necessary. +
- +
-For example: +
- +
-<code bash> +
-vers=$(python --version) +
-Python 2.7.13 +
-echo "{$vers}" +
-{} +
-</code> +
- +
-Even though we specifically asked for the version number, python wrote it to stderr.  Thusit appeared on the terminaland was not captured in the vers variable.  You'd need to use 2>&1 here.+
  
  
bash/output.1611674160.txt.gz · Last modified: 2021/01/26 15:16 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki