From owner-freebsd-questions@FreeBSD.ORG Sun Apr 3 10:00:54 2011 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 AABA5106564A for ; Sun, 3 Apr 2011 10:00:54 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 396FE8FC0A for ; Sun, 3 Apr 2011 10:00:53 +0000 (UTC) Received: by wwc33 with SMTP id 33so5293122wwc.31 for ; Sun, 03 Apr 2011 03:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=SYMAhK5hZVyCIDJ0dY4zysLnTYgwCYpdv2GDzeMROsY=; b=uVT5NOjcy+fP7S1bF8h0qKCSfm7pLYS5fONpsBVoTr4vgaGsdJiTbgnjQWoxVr+kqw w5fOgr+2V2XStKW7tZL1LZbIsyOZdYuMUNupD+3LmqE+UHaq0a8z8/RpOTOq2SEw2EYI eT4Sqd9nNWNe0JfZt74OFOsgjeptwP+CR8kRo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=TrDAbtVYQuTTzKVFmgLhwfUc4ODL22FjhcKhbVeCqE7lUDBzMBP3GkNBWfrhXsnanG Xmds9i4nYTUcHVY+KGT09yZ5ci9eLvQW35DD4RPcAqXkzP479jKhbgDMiCX4POMF4GE0 czcxXKvlffm9GHi5wbv/rT3qKqCQ5SvhUsx0A= Received: by 10.227.197.21 with SMTP id ei21mr5911118wbb.107.1301824852198; Sun, 03 Apr 2011 03:00:52 -0700 (PDT) Received: from Groseille.malikania.fr (65.21.102-84.rev.gaoland.net [84.102.21.65]) by mx.google.com with ESMTPS id o23sm2263021wbc.44.2011.04.03.03.00.50 (version=SSLv3 cipher=OTHER); Sun, 03 Apr 2011 03:00:50 -0700 (PDT) Message-ID: <4D984574.2050402@gmail.com> Date: Sun, 03 Apr 2011 12:01:24 +0200 From: David Demelier User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110320 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <0DD2BF5C-7387-4AFA-BF43-B1683F3773E8@d3photography.com> <20110402130739.4253ea30@napoleon> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: graphical representation of `du` 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: Sun, 03 Apr 2011 10:00:54 -0000 On 02/04/2011 19:30, Chris Rees wrote: > On 2 April 2011 18:22, Chris Rees wrote: >> On 2 April 2011 18:07, Mike Jeays wrote: >>> On Sat, 2 Apr 2011 17:15:04 +0100 >>> Chris Rees wrote: >>> >>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | >>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,' >>> >>> >>> I confess to being impressed... >>> >> >> Yeah, but perhaps I should have used sed instead of the second awk; >> fewer processes: >> >> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed >> -e 's,^[^1-9]*\([^___CTRL-V+TAB______]*\)____CTRL-V+TAB_____*\(.*\)$,\2 >> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,' >> >> That does exactly the same -- where I've put ____CTRL-V+TAB______ you >> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do >> \t. >> >> Chris >> > > Final version: > > http://www.bayofrum.net/~crees/graphical_du.sh > > Maybe I should port it... > Thanks! This rocks! :-) > Chris > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- David Demelier