$RBGB/treelist050815.txt: This note shows how two awk filters can be piped together to convert the output of lg (ls -alsg) into a bde directory tree. ($CWD = RBGB = ~lechner/bde2alpha_rl/sandbox/bdeNT050526/bdegen13/bde). mercury.cs.uml.edu(96)> lg -R | grep '(^\.\/|^d)' | awk -f gettree.awk|wc 164 164 3405 mercury.cs.uml.edu(100)> m gettree.awk { if ($(NF)!="." && $(NF)!=".." && $(NF)!="CVS") print $(NF); } mercury.cs.uml.edu(97)> lg -R|grep '(^\.\/|^d)'|awk -f gettree.awk >treelist050815.txt I post-edited the output to indent names with no : suffix, and remove e.g. prfiles* then edited again to remove more CVS and prfiles* directories and others with no CVS records (not in repository). Every non-leaf directory below bde is listed twice: once as child and as parent. The extracted full treepath names are appended by awk -FS: '{if (NF>1)print$2;}' ------------------------------- bde alpha bdemakelogs doc executables i386-linux ImakeCheckout include lib mpr_util pr_util pr_util_log pr_util_nolog schema snapshot_pr_files src symtxt test tools 77:bde/alpha: executables obj_log obj_nolog 85:bde/alpha/executables: 90:bde/alpha/obj_log: 95:bde/alpha/obj_nolog: 127:bde/doc: idraw 147:bde/doc/idraw: 179:bde/executables: alpha i386-linux 193:bde/executables/alpha: 247:bde/executables/i386-linux: 302:bde/ImakeCheckout: bde 359:bde/include: 393:bde/lib: 428:bde/pr_util: 459:bde/pr_util_log: alpha i386-linux 490:bde/pr_util_log/alpha: bin obj probj 499:bde/pr_util_log/alpha/bin: 504:bde/pr_util_log/alpha/obj: 544:bde/pr_util_log/alpha/probj: 578:bde/pr_util_log/i386-linux: bin obj probj 587:bde/pr_util_log/i386-linux/bin: 593:bde/pr_util_log/i386-linux/obj: 633:bde/pr_util_log/i386-linux/probj: 708:bde/pr_util_nolog: alpha i386-linux 738:bde/pr_util_nolog/alpha: bin obj probj 747:bde/pr_util_nolog/alpha/bin: 752:bde/pr_util_nolog/alpha/obj: 791:bde/pr_util_nolog/alpha/probj: 857:bde/pr_util_nolog/i386-linux: bin obj probj 867:bde/pr_util_nolog/i386-linux/bin: 874:bde/pr_util_nolog/i386-linux/obj: 913:bde/pr_util_nolog/i386-linux/probj: 1000:bde/schema: altSchemas 1008:bde/schema/altSchemas: 1032:bde/snapshot_pr_files: 1239:bde/src: 1328:bde/symtxt: 1342:bde/test: datfiles 1386:bde/test/datfiles: 1552:bde/tools: ========================================== mercury.cs.uml.edu(110)> awk 'BEGIN{FS=":"}{ if (NF>1)print$2;}' treelist050815.txt ---------------- bde/alpha bde/alpha/executables bde/alpha/obj_log bde/alpha/obj_nolog bde/doc bde/doc/idraw bde/executables bde/executables/alpha bde/executables/i386-linux bde/ImakeCheckout bde/include bde/lib bde/pr_util bde/pr_util_log bde/pr_util_log/alpha bde/pr_util_log/alpha/bin bde/pr_util_log/alpha/obj bde/pr_util_log/alpha/probj bde/pr_util_log/i386-linux bde/pr_util_log/i386-linux/bin bde/pr_util_log/i386-linux/obj bde/pr_util_log/i386-linux/probj bde/pr_util_nolog bde/pr_util_nolog/alpha bde/pr_util_nolog/alpha/bin bde/pr_util_nolog/alpha/obj bde/pr_util_nolog/alpha/probj bde/pr_util_nolog/i386-linux bde/pr_util_nolog/i386-linux/bin bde/pr_util_nolog/i386-linux/obj bde/pr_util_nolog/i386-linux/probj bde/schema bde/schema/altSchemas bde/snapshot_pr_files bde/src bde/symtxt bde/test bde/test/datfiles bde/tools ========================================== The above two filters can be combined in a pipe lg -R | grep '(^\.\/|^d)' | awk -f gettree.awk | awk 'BEGIN{FS=":"}{ if (NF>1)print$2;}' which produces the following (it shows the entire directory list unedited, but leaves out the duplicated names; when leaf nodes are filtered having the form prfiles: