From owner-freebsd-questions@FreeBSD.ORG Mon Feb 4 15:21:55 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E3D16A475 for ; Mon, 4 Feb 2008 15:21:55 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4D913C4F5 for ; Mon, 4 Feb 2008 15:21:47 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [IPv6:::1]) by wojtek.tensor.gdynia.pl (8.13.8/8.13.8) with ESMTP id m14FK8FW008357 for ; Mon, 4 Feb 2008 16:20:08 +0100 (CET) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.13.8/8.13.8/Submit) with ESMTP id m14FK6mc008354 for ; Mon, 4 Feb 2008 16:20:08 +0100 (CET) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Mon, 4 Feb 2008 16:20:06 +0100 (CET) From: Wojciech Puchar To: freebsd-questions@freebsd.org Message-ID: <20080204161647.V8347@wojtek.tensor.gdynia.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: bash bug - or what? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 15:21:55 -0000 look at this $SORT is sort -S 512m $tmp2 is input filename (being 2GB size), $tmp3 is output this fragment tries (with success) to randomize lines from $tmp2 and write it to $tmp3 while read ll;do echo $RANDOM $RANDOM $ll done <$tmp2 | $SORT |cut -f 3- -d " " >$tmp3 this works but why bash sucks VM space? 69274 test 1 -8 0 1862M 98008K pipewr 1 8:17 40.28% bash this 1862 is growing until it finishes, resident size is 100M because it gets swapped out. it looks like echo'ed data is kept in bash memory what's wrong?