#!/bin/csh -f
# David R. Williams (dougie@athena.mit.edu)
# You wan't comments?  Put them in yourself...
# If you can't understand it, don't use it...

set W20 = 'ceres python ajax w20-east-1 w20-east-2 w20-east-3 w20-east-4'
set M1 = 'plato'
set M4 = 'pandora medea'
set M6 = 'otho zeno'
set M11 = 'bias'
set M16 = 'helios'
set M37 = 'electra'
set M66 = 'homer'
set E51 = 'picus'


set location = $1
switch ($location)
	case 1:
		set list = "$M1"
	breaksw
	case 4:
		set list = "$M4"
	breaksw
	case 6:
		set list = "$M6"
	breaksw
	case 11:
		set list = "$M11"
	breaksw
	case 16:
		set list = "$M16"
	breaksw
	case 37:
		set list = "$M37"
	breaksw
	case 66:
		set list = "$M66"
	breaksw
	case E51:
		set list = "$E51"
	breaksw
	default:
		set list = "$W20"
	breaksw
endsw

foreach printer ($list)
	lpq -P$printer | grep 'no entries' > /dev/null
	if $status == 0 then
		echo "$printer - printer empty"
	endif
end
if $status == 1 then
	lpr -P$list[1]
	echo `lpq -P$list[1]`
endif



