From owner-freebsd-questions@FreeBSD.ORG Tue Feb 21 14:35:43 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8741416A420 for ; Tue, 21 Feb 2006 14:35:43 +0000 (GMT) (envelope-from vaaf@broadpark.no) Received: from osl1smout1.broadpark.no (osl1smout1.broadpark.no [80.202.4.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A90643D48 for ; Tue, 21 Feb 2006 14:35:42 +0000 (GMT) (envelope-from vaaf@broadpark.no) Received: from osl1sminn1.broadpark.no ([80.202.4.59]) by osl1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IV100EJ9KIUST50@osl1smout1.broadpark.no> for questions@freebsd.org; Tue, 21 Feb 2006 15:35:18 +0100 (CET) Received: from urban.broadpark.no ([213.187.181.70]) by osl1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IV1005KRKISCS00@osl1sminn1.broadpark.no> for questions@freebsd.org; Tue, 21 Feb 2006 15:35:18 +0100 (CET) Date: Tue, 21 Feb 2006 15:35:15 +0100 From: Kristian Vaaf To: questions@freebsd.org Message-id: <7.0.1.0.2.20060221153406.00ed12d8@broadpark.no> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT Cc: Subject: Cool listing script (needs a fix) 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: Tue, 21 Feb 2006 14:35:43 -0000 What's up everybody? When running this: -- #!/usr/local/bin/bash # # Print a structured file and folder list. # $ARBA: tree.sh,v 1.0 2007/11/11 15:05:09 vaaf Exp $ # # Include files: -a, --all # argument="-type d" case $1 in -a | --all) argument="" ;; esac tree='s,^.$,, /^$/d s,[^/]*/\([^/]*\)$,+-----\1, s,[^/]*/,| ,g' pwd; find -s . $argument -print | sed -e "$tree" -- I get: -- # tree -a /home/vaaf/usr +-----commands.txt +-----lyrics.txt +-----people.txt +-----public.txt -- How can I make the same script include an END notice? -- # tree -a /home/vaaf/usr +-----commands.txt +-----lyrics.txt +-----people.txt +-----public.txt | | END -- Anybody know how? Thanks! All the best, Vaaf