#!/bin/rc fn usage { echo 'usage: sdiff file ...' >[1=2] exit usage } args = () while (! ~ $#* 0 && ~ $1 -* && ! ~ $1 --) { switch($1) { case -* args = ($args $1) shift } } if (~ $#* 0) { usage } 9fs sources || exit $status for (file in $*) { if (! ~ $file /*) { file=`{pwd}^/$file } echo --- $file --- diff $args /n/sources/plan9^$file $file }