انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Lec. 10 Standard Text Streams and Redirection

الكلية كلية تكنولوجيا المعلومات     القسم قسم شبكات المعلومات     المرحلة 4
أستاذ المادة احمد مهدي محمد سعيد الصالح       02/01/2019 08:53:25
Standard Out
• When a command executes without any errors, the output produced is known as standard out (also called stdout or STDOUT) • By default stdout is sent to the terminal • You can redirect stdout from a command into a file
Standard Out
• To redirect stdout of a command to a file, use the “>”: $ls > /tmp/ls.txt • A single > will override existing file contents • Use >> to append to the end of a file • Stdout is assign a numeric value of 1, so it could also be used like this: $ls 1> /tmp/ls.txt
Standard Error
• When command encounters an error, it will produce output that is known as standard error (also called stderr or STDERR). • The stderr output is sent to the terminal • The number associated with the standard error file descriptor is 2.
Standard Error
To redirect stderr, use the following syntax: $ls /junk 2> /tmp/output.err • A single 2> will override existing file contents • Use 2>> to append to the end of a file • To discard output, redirect output to the /dev/null file (trash can)

المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .