New answers tagged

1

Lots of good answers here already. Let me just add some simple examples. I can't think of a single reason one would want the output and the error to got to different locations OK, consider the following shell command: ls -l some/directory/that/might/not/exist > directory_content.txt That does a long form listing of the specified directory (if it ...


2

Security. Security and prevention of malicious attack has not been mentioned in any of the answers and should likely be included for completeness. Deriving the nature of an error can assist an attacker in determining the effectiveness of a given attempt. This can be mitigated by separating error reports out and preventing them from reaching an ...


6

To quote from ESR's "Unix Philosophy", 3. Rule of Composition: Design programs to be connected to other programs. 7. Rule of Transparency: Design for visibility to make inspection and debugging easier. 12. Rule of Repair: When you must fail, fail noisily and as soon as possible. To interpret: Programs will often be connected to other programs (or have ...


12

You may not be using these outputs to their full potential, or to their intended meaning. You never want to mix debugging & diagnostic output with actual results of your program. Standard output: the intended result of the program, for example, list of files (ls), modified or processed text file (sed,grep,awk), a compressed file in response to input ...


12

Snips-n-snails probably has the correct answer, but I'll add something since you said: I can't think of a single reason one would want the output and the error to got to different locations Here's one: if they output is large, you want to be able to easily identify if there were any errors. You're probably used to color output and formatting being ...


29

In UNIX, which was developed along with C, it is common to redirect the output of a command to a file or another program. For example, ls -a | more or ls -lr > index. In these cases, you would not want error messages appearing in your list of files, and especially not if the output of one command is being used as an input to another, and inserting an ...


93

You are thinking that all output is for human reading. For instance, take the Unix cpio command. It writes the archive to stdout, which is always redirected to a device or file. It writes the archive with a header before each file that contains the size of the file, which lets it calculate the offset to the next file when reading it back. If there was an ...


125

Because you might not want error messages in your output. According to computer scientist Stephen C. Johnson: One of the most amusing and unexpected consequences of phototypesetting was the Unix standard error file (!). After phototypesetting, you had to take a long wide strip of paper and feed it carefully into a smelly, icky machine which ...


6

Oldstyle ASR-33 teletype machines (telex machines) only handled 7-bit codes. They only handled uppercase English-language characters, the ten digits, and some punctuation. They printed with this little cylindrical print head with a limited number of characters available. Later, tonnage of terminals, both printing and screen-based, came on the market using ...


26

man 7 ascii of Linux Programmer's Manual says, Uppercase and lowercase characters differ by just one bit and the ASCII character 2 differs from the double quote by just one bit, too. That made it much easier to encode characters mechanically or with a non microcontroller-based electronic keyboard and that pairing was found on old teletypes. As ...


16

This chart (showing the hexadecimal values of ASCII characters) outlines manassehkatz's answer graphically: Numbers are at 0x30 + the value of the number Capital letters are at 0x40 + the value of the letter (A=1, B=2 etc) Lowercase letters are at 0x60 + the value of the letter.


110

Why is ASCII this way? First of all, there is no one best sorting order for everything. For example, should UPPER or lower case be first? Should numbers be before or after letters? Too many choices, and no way to please everyone. So they came up with specific pieces that "made sense": Numerals 0x30–0x39 - Easy bit mask to get your integer value. UPPER ...


59

According to ASA X3.4-1963 Appendix A, one of the design considerations was: (7) Ease in the identification of classes of characters Furthermore: A4.4 The character set was structured to enable the easy identification of classes of graphics and controls. And on page 8: A6.3 To simplify the design of typewriter-like devices, it is desirable that ...


Top 50 recent answers are included