CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 06 Aug 2025 05:01:46 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071016162305
location: https://web.archive.org/web/20071016162305/https://examples.oreilly.com/upt2/split/zvi
server-timing: captures_list;dur=0.484534, exclusion.robots;dur=0.017015, exclusion.robots.policy;dur=0.008071, esindex;dur=0.009844, cdx.remote;dur=20.640947, LoadShardBlock;dur=105.506551, PetaboxLoader3.datanode;dur=67.522943
x-app-server: wwwb-app221
x-ts: 302
x-tr: 156
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app221; 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, 06 Aug 2025 05:01:47 GMT
content-type: text/plain
content-length: 3399
x-archive-orig-date: Tue, 16 Oct 2007 16:23:05 GMT
x-archive-orig-server: Apache
x-archive-orig-last-modified: Thu, 28 Jun 2001 21:57:14 GMT
x-archive-orig-etag: "316ad9-d47-3b3ba83a"
x-archive-orig-accept-ranges: bytes
x-archive-orig-content-length: 3399
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, 16 Oct 2007 16:23:05 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 31 Oct 2002 07:49:51 GMT", ; rel="prev memento"; datetime="Wed, 18 Oct 2006 00:09:39 GMT", ; rel="memento"; datetime="Tue, 16 Oct 2007 16:23:05 GMT", ; rel="next memento"; datetime="Tue, 10 Feb 2009 08:42:14 GMT", ; rel="last memento"; datetime="Fri, 25 Mar 2016 02:59:30 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_0_20071016155919_crawl105-c/52_0_20071016162132_crawl100.arc.gz
server-timing: captures_list;dur=0.757622, exclusion.robots;dur=0.026632, exclusion.robots.policy;dur=0.012398, esindex;dur=0.014350, cdx.remote;dur=10.130433, LoadShardBlock;dur=129.376370, PetaboxLoader3.datanode;dur=119.590655, PetaboxLoader3.resolve;dur=124.171298, load_resource;dur=145.420820
x-app-server: wwwb-app221
x-ts: 200
x-tr: 315
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
#
### zvi, zex, zed - gunzip file(s), edit, re-gzip
### Usage: zvi/zex/zed file(s)-or-file(s)[.gz]
##
## THESE PROGRAMS BOTH DO THE SAME THING: UNCOMPRESS ONE OR MORE
## FILE(S), RUN vi, ex OR ed ON THEM, THEN RECOMPRESS THEM IN THE
## BACKGROUND.
##
## WHEN YOU GIVE IT MORE THAN ONE FILE TO EDIT, THE PROGRAM ONLY
## UNCOMPRESSES THE FIRST FILE BEFORE STARTING THE EDITOR. IT DOES THE
## REST IN THE BACKGROUND WHILE YOU EDIT THE FIRST FILE.
##
## ALL THE FILES YOU EDIT HAVE TO BE COMPRESSED BEFORE YOU START THE
## PROGRAM. BUT YOU DON'T HAVE TO TYPE THE .gz EXTENSION(S) IF YOU
## DON'T WANT TO. THAT MEANS YOU CAN USE WILDCARDS OR FILENAMES:
## zvi *.gz
## YOU CAN ALSO REDIRECT INPUT TO USE AN (UNCOMPRESSED!) EDITING SCRIPT:
## zex aprog.c < exscr
##
## WHEN YOU QUIT THE EDITOR, THE RECOMPRESSION STARTS IN THE
## BACKGROUND. IF THERE ARE ANY ERRORS, THE PROGRAM WILL SEND YOU
## MAIL WITH A COPY OF THE ERRORS.
gzip=/usr/local/bin/gzip
fmt=/usr/ucb/fmt
mailer=/usr/ucb/mail
gunzip=/usr/local/bin/gunzip
# UNCOMMENT THE RIGHT LINE FOR YOUR UNIX:
# echo="echo -n" nnl= # BSD
# echo=echo nnl="\c" # SYSV
echo="echo -n" nnl= PATH=/usr/bin:$PATH; export PATH # SunOS
# SHOULD HAVE A trap THAT ASKS ABOUT RECOMPRESSING
# AND CHECKS STATUS OF BACKGROUND gunzip JOBS.... SIGH.
case "$0" in
*zed) prog=ed myname=zed ;;
*zex) prog=ex myname=zex ;;
*zvi) prog=vi myname=zvi ;;
*) echo "$0: quitting: I don't know how to run myself!" 1>&2; exit 1 ;;
esac
t=/tmp/CMPRS$$ # TEMP FILE (REMOVED BY BACKGROUND JOB AT END)
# NOTE: need to understand two-word options like "-c command"
# and pass those to the editor.
for arg
do
case "$arg" in
-*) echo "$myname: I don't understand options (yet)..." 1>&2; exit 1 ;;
*) # ASSUME IT'S A FILE...
case "$arg" in
*.gz) file="`expr $arg : '\(.*\).gz'`" ;; # $arg WITHOUT THE .gz
*) file="$arg" ;; # ASSUME FILE HAS A .gz EXTENSION...
esac
if [ ! -r "${file}.gz" ]
then
echo "$myname: can't read '${file}.gz'." 1>&2
$echo "Do you want to quit [yn](y)? $nnl"
read ans
case "$ans" in
""|[yY]*) exit 1 ;;
*) echo "$myname: I'll skip '$file.gz'..." 1>&2
continue # DON'T ADD $file TO LISTS
;;
esac
fi
# UNCOMPRESS FIRST FILE IN FOREGROUND (LATER, IF ALL ARGS OK):
case "$files" in
"") fgfile="$file" ;;
*) bgfiles="$bgfiles $file" ;;
esac
# $files SHOULD HOLD *UNCOMPRESSED* NAMES.
files="$files $file"
esac
done
case "$fgfile" in
"") echo "Usage: $myname file [files]
You didn't give me any file names." 1>&2
exit 1
;;
*) $gunzip $fgfile || {
echo "$myname quitting: 'gunzip $fgfile' bombed." 1>&2
exit 1
}
;;
esac
# IF gunzip BOMBS, WE'LL ALREADY BE IN THE EDITOR.
# sort-of FIX: SAVE ERRORS AND SHOW THEM WHEN EDITOR EXITS.
# IF NO $bgfiles, DON'T DO ANYTHING:
test -n "$bgfiles" && $gunzip $bgfiles >$t 2>&1 &
$prog $files
if [ -s $t ]
then
echo "$myname: 'gunzip $bgfiles' bombed:" 1>&2
cat $t 1>&2
$echo "Should I try to gzip all files [ny](n)? $nnl"
read ans
case "$ans" in
""|[nN]*) echo "$myname: warning: not gzipping $files" 1>&2; exit 1 ;;
esac
else
s="$myname gzipping ERROR in `pwd`" # MAIL MESSAGE SUBJECT
# USE trap TO ACT LIKE nohup WITHOUT THE nice:
sh -c "trap '' 1 15; $gzip $files >$t 2>&1;
test -s $t && $mailer -s '$s' ${USER-$LOGNAME} <$t; rm -f $t" &
echo $myname: re-gzipping $files in the background... | $fmt 1>&2
fi