From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079343919677.tru64-unix-managers.marc@archive.invalid> From: Danielle Georgette Date: Fri, 28 Apr 2000 00:53:22 +0000 To: tru64-unix-managers Subject: FW: Directory Tree X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079343919677 Morning all, The following script gives a neat directory tree structure listing. It was posted on the AIX managers list, but its so handy I thought people here might get good use from it as well. Its a shell script so it works equally well on Tru64 - i've used it a few times already. So all thanks Daniel Clark, and I hope you don't mind the cross-post Dan! Danielle +-----------------------------------+---------------------------------+ | Danielle Georgette | Two major products came out of | | Unix Admin | Berkeley: LSD and UNIX. I don't | | danielle.georgette@asx.com.au | believe this to be coincidence. | +-----------------------------------+---------------------------------+ | All opinions are my own unless clearly stated otherwise. | +---------------------------------------------------------------------+ -----Original Message----- From: Robert Miller [mailto:Rmille1@SMUD.ORG] Sent: Friday, April 28, 2000 1:54 AM To: AIX-L@PUCC.PRINCETON.EDU Subject: Re: Directory Tree Example: Linux. 'nuff said. ;) --rm > -----Original Message----- > From: Clark, Daniel B. (ITSC) [SMTP:daniel.clark@MAIL.IHS.GOV] > Sent: Thursday, April 27, 2000 8:47 AM > To: AIX-L@PUCC.PRINCETON.EDU > Subject: Re: Directory Tree > > To be honest, this is what I was hoping would be done. The best tools are > the ones that start with an idea then improved upon. > > thanks, > > Dan Clark > > -----Original Message----- > From: Bruce Harvey [mailto:BruceH@ROUTESCAPE.COM] > Sent: Thursday, April 27, 2000 9:32 AM > To: AIX-L@pucc.Princeton.EDU > Subject: Re: Directory Tree > > > As must be usual among UNIXers, I loved it so much I added to it. > > a '-d' option to specify ONLY directories, and an optional argument > to do another directory than the one you're in. > > Hope you don't mind, Dan! > > ----------------------------------------------------------------------- > Bruce T. Harvey ... Special Projects Developer ..... 410.403.2390 (vox) > www.routescape.com ... b.t.harvey@bigfoot.com ...... 410.329.1114 (fax) > http://surfree.homestead.com/btgmharvey/ ...... b.t.harvey@computer.org > ----------------------------------------------------------------------- > Insight Distribution Systems-222 Schilling Circle-Hunt Valley, MD 21031 > > ----------------------------------------------------------------------- > > #!/bin/ksh > # > # dir_tree > # Display from current Directory Tree. > # > homedir=`pwd` > dodir="" > dowhat="Files and Directories" > set -- `getopt d $*` > if [ "$?" != "0" ] > then > exit 1 > fi > > while [ "$1" != "--" ] > do > case $1 in > -d) dodir="-type d " export dodir > dowhat="Directories only" export dowhat > ;; > esac > shift > done > shift > > if [ "$1" != "" ] > then > cd $1 > fi > > { echo "$dowhat ... Directory: `pwd`" > find . $dodir -print | sed ' > s:^'$base':|: > s:/\([^/]*\)$:?? \1: > s:/[^ ?/]*: |:g > s:?:_:g > ' > } > > cd $homedir > > > ----------------------------------------------------------------------- > > > -----Original Message----- > From: Clark, Daniel B. (ITSC) [mailto:daniel.clark@MAIL.IHS.GOV] > Sent: Thursday, April 27, 2000 10:53 AM > To: AIX-L@pucc.Princeton.EDU > Subject: Directory Tree > > > A couple of months ago, someone on the list had asked about a directory > tree > for AIX. ... > > ---------------------------------------------------------------------- > > Dan Clark > Senior System Development Consultant > Rose International, > Indian Health Service > Albuquerque