9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: arisawa@ar.aichi-u.ac.jp
To: 9fans@cse.psu.edu
Subject: Re: [9fans] How to sync venti
Date: Wed,  4 Sep 2002 21:49:51 +0900	[thread overview]
Message-ID: <443d96fc7cbe18e690ea8fa3bf4f5f95@ar.aichi-u.ac.jp> (raw)
In-Reply-To: <3D751FC9.61D67840@research.bell-labs.com>

Thanks a lot, Dharani and Sean

I am now using venti and I am uneasy without that.
My feeling about vac is an engine, not a car.
I wrote some interface to vac and vacfs; the usage is:
	term% ve $home/bin/rc
	term% ve
	...
	2002/09/01 12:03 /usr/arisawa/venti/memo
	2002/09/01 12:06 /usr/arisawa/bin
	2002/09/01 13:34 /usr/arisawa/bin/rc
	2002/09/01 13:38 /usr/arisawa/bin/rc
	term%

	term% vefs 2002/09/01 12:06 /usr/a
	term% ls -l /n/vac
	d-rwxrwxr-x M 2516 arisawa arisawa 0 May  3 06:56 /n/vac/bin
	term% vafs nti/memo
	term% ls -l /n/vac
	--rw-rw-r-- M 2518 arisawa arisawa 37 Sep  1 09:12
/n/vac/memo
Thes codes are:
File: ve
	#!/bin/rc -e
	# name: ve
	# usage: ve [file]
	# coded by Kenji Arisawa
	log=$home/venti/log
	switch($#*){
	case 0
		awk '{print $2,$3,$4}' $log
	case 1
		if(! test -e $1){
			echo $1 not exist
			exit
		}
		d=`{date}
		# $d is: Sun Sep  1 17:43:14 JST 2002
		Jan=01;Feb=02;Mar=03;Apr=04;May=05;Jun=06;
		Jul=07;Aug=08;Sep=09;Oct=10;Nov=11;Dec=12
		day=$d(3)
		if(~ $#day 1)
			day=0^$day
		t=`{ifs=':' echo `{echo $d(4)}}
		t=$t(1)^':'^$t(2)
		d=$d(6)^/^$$d(2)^/^$day^' '^$t
		if(~ $1 /*)
			p=$1
		if not
			p=`{pwd}^/$1	# `^' is required
		a=`{grep ' '^$p^'$' $log | tail -1}
		if(~ $#a 4)
			v=`{vac -h pc -qd <{echo vac:$a(1)} $p}
		if not
			v=`{vac -h pc $p}
		if(! ~ $vac vac:*){
			echo '# vac error'
			exit 'vac error'
		}
		ifs=': ' v=`{echo -n $v} echo $v(2) $d $p >> $log
	case *
		echo 'usage: ve [file]'
	}

File: vefs
	#!/bin/rc -e
	# name: vefs
	# usage: vefs patterm
	# coded by Kenji Arisawa
	log=$home/venti/log
	if(~ $#* 0)
		a=`{tail -1 $log}
	if not
		a=`{grep $"* $log | tail -1}
	if(! ~ $#a 4){
		echo '# pattern not exist'
		exit 'pattern not exist'
	}
	unmount /n/vac >[2] /dev/null
	vacfs -h pc <{echo vac:$a(1)}

Of cause you may have more elegant one, but I love these.

Kenji Arisawa


  reply	other threads:[~2002-09-04 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-03 12:07 arisawa
2002-09-03 20:41 ` Dharani Vilwanathan
2002-09-03 20:47   ` Sean Quinlan
2002-09-04 12:49     ` arisawa [this message]
2002-09-04 19:22       ` arisawa
2002-11-05  4:33 Russ Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443d96fc7cbe18e690ea8fa3bf4f5f95@ar.aichi-u.ac.jp \
    --to=arisawa@ar.aichi-u.ac.jp \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).