Learn BASH -- Pipelines (from bash manual)

本文介绍了管道命令的基本功能,即通过管道连接多个命令,使得前一个命令的输出成为后一个命令的输入。特别指出当使用‘|&’时,第一个命令的标准错误会被连接到第二个命令的标准输入。此外还提到每个管道中的命令都在各自的子shell中执行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Pipe's function: 

    The output of each command in the pipeline is connected via a pipeto the input of the next command. That is, each command reads the previous command's output. Thisconnection is performed before any redirections specified by thecommand.


2. Note: If ‘|&’ is used, the standard error of command1 is connected tocommand2's standard input through the pipe; it is shorthand for2>&1 |. This implicit redirection of the standard error isperformed after any redirections specified by the command.


3. Each command in a pipeline is executed in its own subshell


4. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值