История изменений
Исправление lbvf50txt, (текущая версия) :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Вот подобный текст с примерами с 50 по 54 страницу.
[me@linuxbox ~]$ ls -l /usr/bin > ls-output.txt
[me@linuxbox ~]$ ls -l ls-output.txt
-rw-rw-r-- 1 me me 167878 2012-02-01 15:07 ls-output.txt
#...
[me@linuxbox ~]$ ls -l /usr/bin >> ls-output.txt
#...
[me@linuxbox ~]$ ls -l /bin/usr 2> ls-error.txt
[me@linuxbox ~]$ ls -l /bin/usr > ls-output.txt 2>&1
#...
[me@linuxbox ~]$ ls -l /bin/usr &> ls-output.txt
#...
[me@linuxbox ~]$ ls -l /bin/usr 2> /dev/null
#...
[me@linuxbox ~]$ cat ls-output.txt
[me@linuxbox ~]$ cat movie.mpeg.0* > movie.mpeg
# ... cat with no arguments?
[me@linuxbox ~]$ cat
Отличная книга, тоже всем рекомендую.
В ней примеры Bash Brace Expansions:
[me@linuxbox ~]$ mkdir -p playground/dir-{00{1..9},0{10..99},100}
[me@linuxbox ~]$ touch playground/dir-{00{1..9},0{10..99},100}/file-{A..Z}
Отличные!
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Вот подобный текст с примерами с 50 по 54 страницу.
[me@linuxbox ~]$ ls -l /usr/bin > ls-output.txt
[me@linuxbox ~]$ ls -l ls-output.txt
-rw-rw-r-- 1 me me 167878 2012-02-01 15:07 ls-output.txt
#...
[me@linuxbox ~]$ ls -l /usr/bin >> ls-output.txt
#...
[me@linuxbox ~]$ ls -l /bin/usr 2> ls-error.txt
[me@linuxbox ~]$ ls -l /bin/usr > ls-output.txt 2>&1
#...
[me@linuxbox ~]$ ls -l /bin/usr &> ls-output.txt
#...
[me@linuxbox ~]$ ls -l /bin/usr 2> /dev/null
#...
[me@linuxbox ~]$ cat ls-output.txt
[me@linuxbox ~]$ cat movie.mpeg.0* > movie.mpeg
# ... cat with no arguments?
[me@linuxbox ~]$ cat
Отличная книга, тоже всем рекомендую.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Вот подобный текст с примерами с 50 по 53 страницу.
[me@linuxbox ~]$ ls -l /usr/bin > ls-output.txt
[me@linuxbox ~]$ ls -l ls-output.txt
-rw-rw-r-- 1 me me 167878 2012-02-01 15:07 ls-output.txt
#...
[me@linuxbox ~]$ ls -l /usr/bin >> ls-output.txt
#...
[me@linuxbox ~]$ ls -l /bin/usr 2> ls-error.txt
[me@linuxbox ~]$ ls -l /bin/usr > ls-output.txt 2>&1
#...
[me@linuxbox ~]$ ls -l /bin/usr &> ls-output.txt
#...
[me@linuxbox ~]$ ls -l /bin/usr 2> /dev/null
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Вот подобный текст с примерами с 50 по 53 страницу.
[me@linuxbox ~]$ ls -l /usr/bin > ls-output.txt
[me@linuxbox ~]$ ls -l ls-output.txt
-rw-rw-r-- 1 me me 167878 2012-02-01 15:07 ls-output.txt
#...
[me@linuxbox ~]$ ls -l /usr/bin >> ls-output.txt
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shotts W. E. Jr. «The Linux Command Line - A Complete Introduction»
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shotts W. E. Jr. The Linux Command Line - A Complete Introduction
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shotts W. E. The Linux Command Line - A Complete Introduction
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shots W. E. The Linux Command Line - A Complete Introduction
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Параграф 10.4 не о написании программ, а о их использовании с позиции пользователя.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shots W. E. The Linux Command Line - A complete Instruction
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исправление lbvf50txt, :
Нужно сказать, что стандартный вывод ошибок - это не только про ошибки. Если программа выдает какой-то значимый вывод на экран, сопровождая его комментариями (логом), то первое должно отправляться на stdout, а второе - на stderr, то есть, в stderr падают любые подробности работы программы, не являющиеся данными, которые следует далее обработать в пайплайне.
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shots W. E. The Linux Command Line - A complete Instruction
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.
Исходная версия lbvf50txt, :
Это как раз с позиции пользователя. Пользователь должен понимать, что такое stderr.
Принято. Вот цитата из книги Shots W. E. The Linux Command Line - A complete Instruction
Глава 6 Redirection
Standard Input, Output, and Error
Many of the programs that we have used so far produce output of some kind. This output often consists of two types. First, we have the program’s results; that is, the data the program is designed to produce. Second, we have status and error messages that tell us how the program is getting along. If we look at a command like ls, we can see that it displays its results and its error messages on the screen.
Keeping with the Unix theme of “everything is a file,” programs such
as ls actually send their results to a special file called standard output (often
expressed as stdout
) and their status messages to another file called standard
error (stderr
). By default, both standard output and standard error are linked
to the screen and not saved into a disk file.
In addition, many programs take input from a facility called standard
input (stdin
), which is, by default, attached to the keyboard.
I/O redirection allows us to change where output goes and where input comes from. Normally, output goes to the screen and input comes from the keyboard, but with I/O redirection we can change that.