#!/usr/bin/perl -w # # $Id: snapshot,v 1.2 2005/01/16 21:33:41 vogelke Exp $ # # NAME: # snapshot # # SYNOPSIS: # snapshot file [file ...] # # DESCRIPTION: # "snapshot" prints RCS information about one or more files. # # OPTIONS: # "file" is any file under RCS control. # # AUTHOR: # Karl Vogel use strict; $ENV{'PATH'} = "/bin:/usr/bin:/usr/local/bin"; my $auth = ''; my $date = ''; my $rev = ''; my $wfile = ''; @ARGV || die "no args"; open(R, "rlog @ARGV |") || die "rlog"; while () { if (/^Working file: (.*)/) { $wfile = "$1"; } elsif (/^revision (.*)/) { $rev = "$1" unless length($rev); } elsif (/^date: (.*);.* author: (.*);.* state/) { $date = "$1" unless length($date); $auth = "$2" unless length($auth); } elsif (/^====/) { print "$wfile $rev $date $auth\n"; $wfile = $rev = $date = $auth = ''; } } close(R); exit(0);