CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 17 Jul 2025 14:43:48 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080518204755
location: https://web.archive.org/web/20080518204755/https://examples.oreilly.com/upt2/split/stree
server-timing: captures_list;dur=0.673801, exclusion.robots;dur=0.025673, exclusion.robots.policy;dur=0.012038, esindex;dur=0.012428, cdx.remote;dur=11.073560, LoadShardBlock;dur=1886.711806, PetaboxLoader3.datanode;dur=1716.119748, PetaboxLoader3.resolve;dur=116.520857
x-app-server: wwwb-app222
x-ts: 302
x-tr: 1928
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: SERVER=wwwb-app222; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 17 Jul 2025 14:43:50 GMT
content-type: text/plain
content-length: 1555
x-archive-orig-date: Sun, 18 May 2008 20:47:53 GMT
x-archive-orig-server: Apache
x-archive-orig-last-modified: Mon, 31 Mar 2008 18:10:12 GMT
x-archive-orig-etag: "54c3d3-613-90194900"
x-archive-orig-accept-ranges: bytes
x-archive-orig-content-length: 1555
x-archive-orig-connection: close
cache-control: max-age=1800
x-archive-guessed-content-type: text/plain
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 18 May 2008 20:47:55 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 19 Jun 2002 01:59:25 GMT", ; rel="prev memento"; datetime="Wed, 18 Oct 2006 00:13:27 GMT", ; rel="memento"; datetime="Sun, 18 May 2008 20:47:55 GMT", ; rel="next memento"; datetime="Tue, 10 Feb 2009 09:06:11 GMT", ; rel="last memento"; datetime="Fri, 25 Mar 2016 02:58:49 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_3_20080518193113_crawl107-c/52_3_20080518204733_crawl100.arc.gz
server-timing: captures_list;dur=0.965007, exclusion.robots;dur=0.036487, exclusion.robots.policy;dur=0.017082, esindex;dur=0.024464, cdx.remote;dur=87.606275, LoadShardBlock;dur=861.034159, PetaboxLoader3.datanode;dur=1319.409607, load_resource;dur=655.801605, PetaboxLoader3.resolve;dur=84.051488
x-app-server: wwwb-app222
x-ts: 200
x-tr: 1649
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
#! /bin/sh
#
### stree - make simple directory tree
### Usage: stree [-a] reldirpath
##
## stree IS A SIMPLE WAY TO MAKE A DIRECTORY TREE. THOUGH THERE ARE
## BETTER ONES ELSEWHERE, stree IS SIMPLE AND HAS SOME NEAT USES OF
## sed AND tr IN IT.
##
## IF YOU GIVE IT THE PATH TO A DIRECTORY (USE A RELATIVE PATH!):
## % stree bin
## IT'LL SHOW YOU ONLY THE SUBDIRECTORIES. WITH THE -a OPTION:
## % stree -a bin
## IT SHOWS DIRECTORIES AND FILES.
#
# Posted to USENET by
# James A. Woods {hplabs,hao,ihnp4}!ames!jaw (jaw@riacs.ARPA)
# Attributed to
# Doug Kerr of Informatics General Corp.
#
# Original one-liner (hacked up by Jerry Peek):
# echo $1; find $1 -type d -print | tr / \\1 | sort -f | tr \\1 / |\
# sed -e s,\^$1,, -e /\^$/d -e "s,[^/]*/, \" ,g"
#
# Explanation: it works by substituting tabs for pathname slashes
# (the invisible literal tab occurs before the ",g" above); the
# translits bracketing the sort helps alphabetize / before [a-zA-Z].
# And if you remember that other punctuation can replace the slash
# in ed/sed syntax (as the comma does in the script), you needn't
# say "Deadhead Ed had edited it" fifty times fast.
case "$1" in
-a) shift
dir=${1-.} # DEFAULT TO CURRENT DIRECTORY
echo Tree for directory $dir and its files:
;;
*) findtype="-type d" # IF NO -a FLAG, MAKE find USE "-type d"
dir=${1-.}
echo Tree for directory $dir:
;;
esac
echo "
$dir"
find $dir $findtype -print |
tr / \\001 | sort -f | tr \\001 / |
sed -e s@\^$dir@@ -e /\^$/d -e 's@[^/]*/@ " @g'
# THIS CHARACTER IS A TAB..................^