Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Display unix directory hierarchy

RE: Display unix directory hierarchy

From: Bellow, Bambi <bbellow_at_chi.navtech.com>
Date: Tue, 23 Dec 2003 10:59:24 -0800
Message-ID: <F001.005DAE93.20031223105924@fatcity.com>


Here's a freebie...

Bambi.



#!/bin/ksh
LEVEL=1
INCREMENT=FALSE
ls -lR|grep -v ^total|while read i
do

    echo $i|grep ^d >/dev/null 2>/dev/null     if [ $? -eq 0 ] ;
    then

        continue
    fi
    FILE=`echo $i|awk '{print $NF}'`

    echo $i|grep "\/" >/dev/null 2>/dev/null     if [ $? -eq 0 ] ;
    then

        LEVEL=`expr \`echo $i|awk -F/ '{print NF}'\` - 1`
        FILE=`echo $i|awk -F/ '{print "/" $NF}'|sed "s/://"`
        INCREMENT=TRUE

    fi

    CTR=1
    while [ $CTR -lt $LEVEL ] ;
    do

        echo "  \c"
        let CTR=CTR+1

    done
    echo $FILE
    if [ $INCREMENT = "TRUE" ] ;
    then
        let LEVEL=LEVEL+1
        INCREMENT=FALSE

    fi
done|pg

-----Original Message-----
Sent: Tuesday, December 23, 2003 10:49 AM To: Multiple recipients of list ORACLE-L

Hi, listers.
As documentation for a project, I would like to display some unix directories in hierarchical format and add the output to the documentation set.
(Solaris 9)

Either flowchart-like or explorer-like will do. Sorta like what is shown below. Does anyone know of a freebie tool that will do this? (Or is this some fancy ls command I'm missing?)

Thanks for any help.
Barb

/dna
  /orasrv

     /1.4
        /scripts
     /1.7
        /scripts

  /logs

Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Barbara Baker
  INET: barbarabbaker_at_yahoo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bellow, Bambi INET: bbellow_at_chi.navtech.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Tue Dec 23 2003 - 12:59:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US