#\!/bin/csh
# this travesty authored 7/29/87 by Mrose
#

cd
set dir="."

# break out if QUIT selected
while ($dir != "QUIT")

# break out if no selection
#	if ($dir == "NULL") then
#		set dir="."	
#		continue
#	endif

# generate a menu file
	echo ".." >/tmp/$$.$dir
	/bin/ls >>/tmp/$$.$dir
	echo "QUIT" >>/tmp/$$.$dir

# run menutest and get a selection
	set selection=`/mit/visual/tools/mentor/menutest /tmp/$$.$dir`

# strip it of the trailing ".", because I can't recompile (grrrr!)
	set dir=`echo $selection[3] |sed 's/.$//'`

# cd to it if it's a dir
	if (-d $dir) then
		cd $dir
		continue
#if it's not a dir, maybe it's a file to look at
	else if (-f $dir) then
		xterm =82x44+25+25 -n $dir -e /usr/new/jove $dir
		wait
		continue
		endif

# if it's not a dir, file, QUIT, or NULL, ignore it!
	else
		echo "Sorry, nothing I can do for you."
		continue
	endif

end

rm /tmp/$$*
exit
