#!/bin/csh

echo foo
find . -name foo -exec rm {} \;
find . -name 'foo*' -exec rm {} \;
echo sharp
find . -name '#*' -exec rm {} \;
echo hide
find . -name '.*' -exec rm {} \;
echo nyoro
find . -name '*~' -exec rm {} \;
echo .b
find . -name '*.b' -exec rm {} \;
echo .bb
find . -name '*.bb' -exec rm {} \;
echo .bak
find . -name '*.bak' -exec rm {} \;
echo .BAK
find . -name '*.BAK' -exec rm {} \;
echo core
find . -name core -exec rm {} \;
find . -name 'core*' -exec rm {} \;
echo a.out
find . -name a.out -exec rm {} \;
echo cosmos.t
find . -name cosmos.t -exec rm {} \;
echo landscape.t
find . -name landscape.t -exec rm {} \;

echo rm work

foreach a ( gbs/env/proj/unix/*/work )
    echo $a
    mv $a/CVS tmp.CVS
    mv $a/d tmp.d
    rm -r $a/*
    mv tmp.CVS $a/CVS
    mv tmp.d $a/d
end

echo rm lib

foreach a ( gbs/env/proj/unix/*/lib )
    echo $a
    mv $a/CVS tmp.CVS
    mv $a/d tmp.d
    rm -r $a/*
    mv tmp.CVS $a/CVS
    mv tmp.d $a/d
end


echo rm bin

foreach a ( gbs/env/proj/unix/*/bin )
    echo $a
    mv $a/CVS tmp.CVS
    mv $a/d tmp.d
    rm -r $a/*
    mv tmp.d $a/d
    mv tmp.CVS $a/CVS
end

echo unix

mv gbs/env/proj/unix/CVS tmp.CVS.u

foreach a ( gbs/env/proj/unix/* )
    echo $a
    mv $a/bin tmp.bin
    mv $a/work tmp.work
    mv $a/lib tmp.lib
    mv $a/CVS tmp.CVS
    rm -r $a/*
    mv tmp.bin $a/bin
    mv tmp.lib $a/lib
    mv tmp.work $a/work
    mv tmp.CVS $a/CVS
end

mv tmp.CVS.u gbs/env/proj/unix/CVS
