CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 16 Jul 2025 21:22:49 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090210090611
location: https://web.archive.org/web/20090210090611/https://examples.oreilly.com/upt2/split/stree
server-timing: captures_list;dur=0.479699, exclusion.robots;dur=0.022700, exclusion.robots.policy;dur=0.013616, esindex;dur=0.009925, cdx.remote;dur=28.566501, LoadShardBlock;dur=284.818581, PetaboxLoader3.datanode;dur=160.045581, PetaboxLoader3.resolve;dur=50.458243
x-app-server: wwwb-app200
x-ts: 302
x-tr: 343
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app200; 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: Wed, 16 Jul 2025 21:22:49 GMT
content-type: text/plain
content-length: 1555
x-archive-orig-date: Tue, 10 Feb 2009 09:06:10 GMT
x-archive-orig-server: Apache
x-archive-orig-last-modified: Mon, 31 Mar 2008 18:10:12 GMT
x-archive-orig-etag: "12457c9-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: Tue, 10 Feb 2009 09:06:11 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="Sun, 18 May 2008 20:47:55 GMT", ; rel="memento"; datetime="Tue, 10 Feb 2009 09:06:11 GMT", ; rel="next memento"; datetime="Wed, 30 Sep 2015 17:27:55 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_8_20090210075601_crawl103-c/52_8_20090210090608_crawl100.arc.gz
server-timing: captures_list;dur=0.689297, exclusion.robots;dur=0.030916, exclusion.robots.policy;dur=0.017947, esindex;dur=0.012787, cdx.remote;dur=105.805424, LoadShardBlock;dur=341.634871, PetaboxLoader3.datanode;dur=177.948458, PetaboxLoader3.resolve;dur=286.631142, load_resource;dur=153.335376
x-app-server: wwwb-app200
x-ts: 200
x-tr: 627
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
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..................^