Difference between revisions of "Stdout"
From Hackepedia
Jump to navigationJump to searchLine 1: | Line 1: | ||
− | stdout is short for '''standard output'''. It is always descriptor number 1 in a unix program. In [[ | + | stdout is short for '''standard output'''. It is always descriptor number 1 in a unix program. |
+ | |||
+ | $ ls 1> /tmp/ls.stdout | ||
+ | |||
+ | This will redirect all of stdout to the file /tmp/ls.stdout | ||
+ | |||
+ | |||
+ | == [[UBO]]s == | ||
+ | |||
+ | Standard output is defined in /usr/include/unistd.h as a macro that is called STDOUT_FILENO and its value is 1. | ||
+ | |||
+ | |||
+ | == [[*BSD]] == | ||
+ | |||
+ | In BSD based [[OS]]' stdout can be represented as /dev/fd/1 or /dev/stdout. You can see more about this by typing "man 4 stdout" or "man 4 fd". | ||
+ | |||
+ | == [[Linux]] == | ||
+ | |||
+ | In Linux based [[OS]]' you will want to read the [[Manual]] pages for stdin(3) and stdio(3). This is defined in /usr/include/unistd.h |
Latest revision as of 17:25, 8 April 2006
stdout is short for standard output. It is always descriptor number 1 in a unix program.
$ ls 1> /tmp/ls.stdout
This will redirect all of stdout to the file /tmp/ls.stdout
UBOs
Standard output is defined in /usr/include/unistd.h as a macro that is called STDOUT_FILENO and its value is 1.
*BSD
In BSD based OS' stdout can be represented as /dev/fd/1 or /dev/stdout. You can see more about this by typing "man 4 stdout" or "man 4 fd".
Linux
In Linux based OS' you will want to read the Manual pages for stdin(3) and stdio(3). This is defined in /usr/include/unistd.h