已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
fdfs的疑问Windows系统 电脑资料 filedescriptor是个什么东西 举例说下 谢谢 iricyan 回复于:xx-11-19 23:42:13 0 1 2 红头发 回复于:xx-11-20 06:45:54 whut? 012? guchengman 回复于:xx-11-20 18:33:04 0是标准输出, 1是标准输入. 2是标准错误, 如:cat/etc/passw file descriptor是个什么东西 举例说下 谢谢 iricyan 回复于:xx-11-19 23:42:130 1 2 红头发 回复于:xx-11-20 06:45:54whut? 012? guchengman 回复于:xx-11-20 18:33:040是标准输出, 1是标准输入. 2是标准错误, 如: cat 其原理是利用输入重定向, 但其完整写法应该是: cat 0 ls -la.txt可以把ls命令保存到一个文件当中, 在这完整写法应该是 ls -l 1a.txt 当你运行ls -l /errdir 时会有错误提示, 我们可以用标准错误重定向来把错误提示保存到一个文件中或丢弃. ls -l /errdir 2/tmp/a.txt 把错误保存在/tmp/a.txt文件中. ls -l /errdir 2/dev/null 把错误提示丢弃,也即不显示. mmmmn 回复于:xx-11-20 18:44:38真是开玩笑,文件句柄能是这东西? 红头发 回复于:xx-11-20 19:18:29谢谢我消化下 guchengman 回复于:xx-11-20 21:48:38quote:8544bbfcb5=mmmmn真是开玩笑,文件句柄能是这东西?/quote:8544bbfcb5 其实我也是有疑问, 但是在书上只是写了 1 2 3 之类的东东, 加上前者所说, 我就因此回复, 还请大侠出来分析一下. iricyan 回复于:xx-11-20 22:38:59ops: 写错了, laoxia 回复于:xx-11-21 06:40:17quote:af318e44a5=guchengman0是标准输出, 1是标准输入. 2是标准错误, 如: cat 其原理是利用输入重定向, 但其完整写法应该是: cat 0 ls -la.txt可以把./quote:af318e44a5This is right. file descriptor 0, 1, 2 are not all of the descriptors. but they are the most monly used ones. laoxia 回复于:xx-11-21 06:49:50b:8ee48ac867Standard In, Standard Out, and Standard Error/b:8ee48ac867 When writing shell scripts, you can control input/output redirection. Input redirection is the ability to force a mand to read any necessary input from a file instead of from the keyboard. Output redirection is the ability to send the output from a mand into a file or pipe instead of to the screen. Each process created by a shell script begins with three color=red:8ee48ac867file descriptors/color:8ee48ac867 associated with it, as shown in Figure 16-1. These color=red:8ee48ac867file descriptors/color:8ee48ac867standard input, standard output, and standard errordetermine where input to the process es from, and where the output and error messages are sent. Standard input (STDIN) is always file descriptor 0. Standard input is the place where the shell looks for its input data. Usually data for standard input es from the keyboard. You can specify standard input to e from another source using input/output redirection. Standard output (STDOUT) is always color=red:8ee48ac867file descriptor/color:8ee48ac867 1. Standard output (default) is the place where the results of the execution of the program are sent. Usually, the results of program execution are displayed on the terminal screen. You can redirect standard output to a file, or suppress it pletely by redirecting it to /dev/null.Standard error (STDERR) is always color=red:8ee48ac867file descriptor /color:8ee48ac8672. Standard error is the place where error messages are sent as they are generated during mand processing. Usually, error messages are displayed on the terminal screen. You can redirect standard error to a file, or suppress it pletely by redirecting it to /dev/null. You can use the color=red:8ee48ac867file descriptor /color:8ee48ac867numbers 0 (standard input), 1 (standard output), and 2 (standard error) together with the redirection metacharacters to control input and output in the Bourne and Korn shells. Table 16-7 shows the mon ways you can redirect file descriptors. i:8ee48ac867Table 16-7 Bourne and Korn Shell Redirection /i:8ee48ac867 - Description Command color=red:8ee48ac867Take STDIN from file Redirect STDOUT to file file, or 1file Redirect STDERR to file 2 file Append STDOUT to end of file file Redirect STDERR to STDOUT 2&1 Pipe standard output of cmd1 as standard input to cmd2 cmd1 | cmd2 Use file as both STDIN and STDOUT file Close STDIN &- Close STDERR 2&- /color:8ee48ac867 - When redirecting STDIN and STDOUT in the Bourne and Korn shells, you can omit the file descriptors 0 and 1 from the redirection symbols. You must always use the file descriptor 2 with the redirection symbol. The 0 and 1 file descriptors are implied, and not used explicitly for the C shell, as shown in Table 16-8. The C shell representation for standard error (2) is an ampersand (&). STDERR can only be redirected when redirecting STDOUT. i:8ee48ac867Table 16-8 C Shell Redirection Metacharacters /i:8ee48ac867 - color=red:8ee48ac867Description Command Redirect STDOUT to file file Take input from file file Redirect STDOUT and STDERR to file & file Append S
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年一级注册建筑师之设计前期与场地设计通关提分题库及完整答案
- 胆囊钙化的护理
- 雨课堂学堂在线学堂云《材料成形技术基础(合工大)》单元测试考核答案
- 高考化学“8+1”模拟练试卷含答案(十七)
- 2025福建省晋江文旅集团有限公司及其权属子公司招聘工作人员11人历年真题汇编附答案解析
- 2026年度全国社会工作者《社会工作实务》备考真题带答案解析
- 四川港荣能源集团有限公司招聘历年真题汇编带答案解析
- 2025重庆市属事业单位第四季度遴选工作人员43人历年真题库附答案解析
- 2026年(通讯维修工)理论知识考试题库及参考答案【考试直接用】
- 青岛市卫生健康委员会直属事业单位校园招聘2026届高校毕业生(407名)历年真题汇编附答案解析
- 2024年秋季学期新人教版数学一年级上册课件 第5单元 20以内的进位加法 3 5、4、3、2加几 练一练
- 巨量引擎信息流广告(初级)认证理论试题库资料(含答案)
- (正式版)CB∕T 4553-2024 船舶制造舱室封舱及密性试验作业安全管理规定
- 承德施工组织设计暗标
- 冬季施工安全措施
- 中建EPC工程总承包项目全过程风险清单(2023年)
- 高职院校学前教育专业教学标准汇总
- 床旁教学与患者教育的原则与方法
- 干部宪法知识讲座
- 体育室内课《篮球ppt课件》
- 餐厅小票打印模板
评论
0/150
提交评论