#!/bin/csh -f
# @(#)bldrgb 23.2 90/06/19
#
# Copyright (c) 1987 by Sun Microsystems, Inc.
#
set CMD = `basename $0`

if ( ! $?OPENWINHOME ) then
	set OPENWINHOME = /home/openwin
endif

foreach i ( . ${OPENWINHOME}/lib )
    if ( -r "$i/rgb.txt" ) then
	echo "$CMD : using $i/rgb.txt"
	cd $i
	goto rgbtxtfound
    endif
end

echo "$CMD: rgb.txt not found"
exit 2

rgbtxtfound:

# find rgb
foreach i ( ../bin ${OPENWINHOME}/bin $path )
    if ( -x "$i/rgb" ) then
	set RGB = "$i/rgb"
	echo "$CMD : using $RGB"
	goto rgbfound
    endif
end

echo "$CMD: rgb not found"
exit 2

rgbfound:

${RGB} rgb < rgb.txt
