From nobody Mon Apr 03 21:52:47 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pr4Q35qlMz43MtG for ; Mon, 3 Apr 2023 21:52:59 +0000 (UTC) (envelope-from freebsd-questions-3@voidcaptain.com) Received: from mx3.mx00.net (mx3.mx00.net [IPv6:2600:3c01::f03c:91ff:fe89:a3f5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "mx3.mx00.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pr4Q272ljz3GYm for ; Mon, 3 Apr 2023 21:52:58 +0000 (UTC) (envelope-from freebsd-questions-3@voidcaptain.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of freebsd-questions-3@voidcaptain.com designates 2600:3c01::f03c:91ff:fe89:a3f5 as permitted sender) smtp.mailfrom=freebsd-questions-3@voidcaptain.com; dmarc=pass (policy=reject) header.from=voidcaptain.com Received: from razz.mx00.net [2600:3c01::f03c:91ff:fed5:a231] by mx3.mx00.net with ESMTP id 20230329-1pjS6c-0002Aj-2V for ; Mon, 03 Apr 2023 21:52:50 +0000 Message-ID: Date: Mon, 3 Apr 2023 14:52:47 -0700 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Language: en-US To: questions@freebsd.org From: Pete Subject: Clogged pipe? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-0.75 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.96)[0.956]; NEURAL_HAM_MEDIUM(-0.91)[-0.911]; DMARC_POLICY_ALLOW(-0.50)[voidcaptain.com,reject]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[questions@freebsd.org]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; ARC_NA(0.00)[]; ASN(0.00)[asn:63949, ipnet:2600:3c01::/32, country:SG]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4Pr4Q272ljz3GYm X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On FreeBSD 13.1-RELEASE-p7 I have a small test file, named testfile, which contains three short lines of text, "one," "two," and "three" without the quotes. This command waits indefinitely without producing any output: tail -f testfile | cat -n | sed -u 's/^/X/' But, these five commands all work as expected, immediately outputting versions of the three lines of text: tail -f testfile | cat -n cat -n testfile | sed -u 's/^/X/' tail -f testfile | sed -u 's/^/X/' tail testfile | cat -n | sed -u 's/^/X/' tail -f testfile | cat | sed -u 's/^/X/' What is it about the first command, that causes it to produce no output, that isn't also the case with any of the last five? It doesn't matter whether the commands are run in sh, csh, or bash, the result is the same. Interestingly (or maybe not), the issue doesn't occur on my Debian box; all six commands produce immediate output there in both dash and bash. Can anyone explain what makes the first command behave differently than the others?