#!/bin/csh
set path = ( /etc /usr/ucb /usr/bin /bin )
set files = ( /export/root{0,1}/Common/$1 )
foreach i ( /export/root{0,1} )
    echo Doing $i
    cd $i
    set nonomatch
    set existing = (*/$1)
    unset nonomatch
    if ($#existing != 1) then
	echo "Can not create $1 because $existing exist"
	exit(1)
    endif
    if ("$existing" != "*/$1") then
	echo "Can not create $1 because $existing exists"
	exit(1)
    endif
    touch Common/$1
    chown norm Common/$1
    chgrp xkernel Common/$1
    chmod 775 Common/$1
    foreach j ( * )
	if ( -d $j ) then
	    if ( $j == Common || $j == lost+found || $j == fix) then
		# do nothing
	    else
		echo Linking to $j
		ln Common/$1 $j/$1
	    endif
	endif
    end
end
