From owner-freebsd-questions@FreeBSD.ORG Mon Dec 3 18:09:55 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BBE936F for ; Mon, 3 Dec 2012 18:09:55 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA418FC16 for ; Mon, 3 Dec 2012 18:09:54 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TfaSm-0003ti-LZ for freebsd-questions@freebsd.org; Mon, 03 Dec 2012 19:09:54 +0100 Received: from 79-139-19-75.prenet.pl ([79.139.19.75]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Dec 2012 19:09:52 +0100 Received: from jb.1234abcd by 79-139-19-75.prenet.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Dec 2012 19:09:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: jb Subject: Re: bash pipe redirection gets stuck Date: Mon, 3 Dec 2012 18:09:27 +0000 (UTC) Lines: 25 Message-ID: References: <23353.144.36.114.84.1354545315.squirrel@mail.rule.lv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 79.139.19.75 (Mozilla/5.0 (X11; FreeBSD i386; rv:9.0.1) Gecko/20100101 Firefox/9.0.1) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:09:55 -0000 rule.lv> writes: > > Dear all, > I stumbled upon a problem where multiple pipe redirection occasionally get > stuck when trying to get sha256 sum of a stream. > > You can try to reproduce the problem if you have /usr/ports/shells/bash > installed (output redirection used in this command is possible only in > bash). > Create temporary test file with command: "dd if=/dev/urandom of=/tmp/file1 > bs=1k count=10" > And the command I'm using is: > /usr/local/bin/bash -c 'cat /tmp/file1 | tee >(/sbin/sha256 > > /tmp/file1.sha256) > /tmp/file1.copy' ; echo $status > ... Do you get stuck with this ? Does it make any difference ? /usr/local/bin/bash -c 'cat /tmp/file1 | tee /tmp/file1.copy | /sbin/sha256 \ /tmp/file1.sha256' ; echo $status jb