【发布时间】:2022-01-26 04:25:19
【问题描述】:
我想知道为什么我无法从管道的输出中读取该行。以下是我的命令:
find / -name sysinit.target 2> /dev/null | head -n1 | read
我希望找到从head 的输出中读取的行记录在系统变量$REPLY 中,但该变量中没有任何内容。为什么head输出的行没有被read记录在变量$REPLY中?
【问题讨论】:
-
这也是BashFAQ #24的主题。
-
head -n1也完全不需要。
标签: bash