CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 16 Jul 2025 04:29:37 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090210084049
location: https://web.archive.org/web/20090210084049/https://examples.oreilly.com/upt2/split/cgrep
server-timing: captures_list;dur=0.980278, exclusion.robots;dur=0.041928, exclusion.robots.policy;dur=0.025840, esindex;dur=0.015067, cdx.remote;dur=119.318845, LoadShardBlock;dur=501.784874, PetaboxLoader3.datanode;dur=88.911118, PetaboxLoader3.resolve;dur=253.394470
x-app-server: wwwb-app28
x-ts: 302
x-tr: 664
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app28; 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 04:29:38 GMT
content-type: text/plain
content-length: 825
x-archive-orig-date: Tue, 10 Feb 2009 08:40:49 GMT
x-archive-orig-server: Apache
x-archive-orig-last-modified: Mon, 31 Mar 2008 18:10:12 GMT
x-archive-orig-etag: "1bac17-339-90194900"
x-archive-orig-accept-ranges: bytes
x-archive-orig-content-length: 825
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 08:40:49 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sun, 18 Aug 2002 00:43:13 GMT", ; rel="prev memento"; datetime="Sun, 18 May 2008 20:43:27 GMT", ; rel="memento"; datetime="Tue, 10 Feb 2009 08:40:49 GMT", ; rel="next memento"; datetime="Wed, 30 Sep 2015 17:26:59 GMT", ; rel="last memento"; datetime="Fri, 25 Mar 2016 03:18:23 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_20090210084027_crawl100.arc.gz
server-timing: captures_list;dur=0.773057, exclusion.robots;dur=0.037614, exclusion.robots.policy;dur=0.024581, esindex;dur=0.011122, cdx.remote;dur=9.129625, LoadShardBlock;dur=867.280733, PetaboxLoader3.resolve;dur=756.946804, PetaboxLoader3.datanode;dur=349.192880, load_resource;dur=287.497528
x-app-server: wwwb-app28
x-ts: 200
x-tr: 1203
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
#!/usr/bin/perl
# Usage: cgrep [-lines] pattern [files]
$context = 3;
# They might want more or less context.
if ($ARGV[0] =~ /^-(\d+)$/) {
$context = $1;
shift;
}
# Get the pattern and protect the delimiter.
$pat = shift;
$pat =~ s#/#\\/#g;
# First line of input will be middle of array.
# In the eval below, it will be $ary[$context].
$_ = <>;
push(@ary,$_);
# Add blank lines before, more input after first line.
for (1 .. $context) {
unshift(@ary,'');
$_ = <>;
push(@ary,$_) if $_;
}
# Now use @ary as a silo, shifting and pushing.
eval < if \$_;
shift(\@ary);
push(\@ary,\$_);
}
LOOP_END