#!/bin/rc

rfork e
ifs='
'

if(~ $#* 1 && ~ $1 -i) {
	shift
	for(i in /dev/wsys/*){
		x=`{read $i/label}
		if(~ $#* 0) echo top''''$x'''''#' $i
	}
	exit
}

for(i in /dev/wsys/*){
	x=`{read $i/label}
	if(~ $#* 0) echo top $x
	if not if(~ $x $"*){
		echo top> $i/wctl
		echo current> $i/wctl
	}
}
