APUE练习题3.5 - 文件重定向

本文详细解析了Linux Unix下的文件重定向命令,通过实例分析了`./a.out > outfile 2>&1`及`./a.out 2>&1 > outfile`两条命令的执行过程。第一条命令使得标准输出和标准错误都指向outfile,第二条命令则先将标准错误重定向到标准输出,再将标准输出重定向到outfile,导致最终结果不同。
摘要由CSDN通过智能技术生成

原题

3.5

The Bourne shell, Bourne-again shell, and Korn shell notation

     digit1>&digit2

says to redirect descriptor digit1 to the same file as descriptordigit2. What is the difference between the two commands

     ./a.out > outfile 2>&1
     ./a.out 2>&1 > outfile

(Hint: the shells process their command lines from left to right.)

大意就是问这两条命令的区别:

 ./a.out > outfile 2>&1
 ./a.ou

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值