64 lines · 1.2 KB · rc
RawDownload
#!/bin/rc# Print a listing of an object, often a dictionary or an array. Something# like ==, but the output is often easier to read and closer to PostScript# that can be sent back through the interpreter.# POSTLIB=/sys/lib/postscript/prologuesPROLOGUE=$POSTLIB/grabit.ps COPYFILE=RECURSIVE=trueOMITNAMES='/Grabit /GrabitDict' NONCONFORMING='%!PS'ENDPROLOG='%%EndProlog'BEGINSETUP='%%BeginSetup'ENDSETUP='%%EndSetup'TRAILER='%%Trailer' SETUP=GrabitSetup while (! ~ $#* 0 && ~ $1 -*) {	switch ($1) {	case -d;  RECURSIVE=false 	case -o;  shift; OMITNAMES=$OMITNAMES' '$1	case -o*; OMITNAMES=$OMITNAMES' '`{echo $1 | sed s/-o//} 	case -C;  shift; COPYFILE=$COPYFILE' '$1	case -C*; COPYFILE=$COPYFILE' '`{echo $1 | sed s/-C//} 	case -L;  shift; PROLOGUE=$1	case -L*; PROLOGUE=`{echo $1 | sed s/-L//} 	case --; 	case -*;  echo $0: illegal option $1 >[1=2]; exit 1    }    shiftdone echo $NONCONFORMINGcat $PROLOGUEecho $ENDPROLOGecho $BEGINSETUPif (~ $COPYFILE '') COPYFILE=/dev/nullcat $COPYFILEecho 'GrabitDict begin'echo '/recursive '$RECURSIVE' def' echo markfor (i in $OMITNAMES) {	switch ($i) {	case /*; echo $i	case ?*; echo /$i	}}echo GrabitSetup echo endecho $ENDSETUP for (i) echo $i Grabit