From owner-freebsd-questions@FreeBSD.ORG Fri Dec 15 13:47:41 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 B593416A49E for ; Fri, 15 Dec 2006 13:47:41 +0000 (UTC) (envelope-from vsrivastav@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2B0943CBE for ; Fri, 15 Dec 2006 13:45:49 +0000 (GMT) (envelope-from vsrivastav@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so683853wxc for ; Fri, 15 Dec 2006 05:47:30 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:subject:from:to:in-reply-to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=sE6ZoUHKNEnWI8C9rPKYg/kEjPzlvYJpYehJUl8lWALAw2zw50q2Ab/C2QwipPcfwQETOoYlNaNGKXo1mhMr1w5/er0CwTX2fV1HrbgLgku57nQ0PmlikZJFbQoMKknjryoFDMClzbgmeRIGHCeFP1pnpC7VUaj/ZnudHLLIe9c= Received: by 10.70.32.10 with SMTP id f10mr1055117wxf.1166190450469; Fri, 15 Dec 2006 05:47:30 -0800 (PST) Received: from ?192.168.193.118? ( [12.178.90.2]) by mx.google.com with ESMTP id i11sm3513278wxd.2006.12.15.05.47.29; Fri, 15 Dec 2006 05:47:29 -0800 (PST) From: Vivek Srivastav To: freebsd-questions@freebsd.org In-Reply-To: Content-Type: text/plain Date: Fri, 15 Dec 2006 08:47:25 -0500 Message-Id: <1166190445.20205.8.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 (2.8.2.1-2.fc6) Content-Transfer-Encoding: 7bit Subject: Need to simplify a script that makes cool trees 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: Fri, 15 Dec 2006 13:47:41 -0000 I may be responding a little late but just saw your post and no answers posted. Maybe you have already sorted out your problem: Here is a simple modification of your script. Put this function in your .bashrc and use the tree command. tree () { dirs=${@:-.}; echo "Listing $dirs"; for i in $dirs; do find $i -name \* | sed -e 's,^.$,,' \ -e '/^$/d' \ -e 's,[^/]*/\([^/]*\)$,+-----\1,' \ -e 's,[^/]*/,| ,g'; done }