#!/bin/csh -f
# Aaron Sloman                                  Sun Nov 26 1989
# Makes a new sub-directory matching the first argument in all the
# directories named in subsequent arguments.
# e.g. makenewsubdir contrib/teach C.all S.*
# or   makenewsubdir lib/ved/foo C.vms S.vaxvms

if ( "$1x" == "x" ) then
    echo "Format is like:"
    echo "   makenewsubdir contrib/teach C.all S.*"
    echo "   makenewsubdir lib/ved/foo C.vms S.vaxvms"
    echo ""
    exit
endif

umask 22

set newdir = $1
shift

cd $popmaster

foreach dir ($*)
    if (-d $dir) then
        echo $dir/$newdir
        mkdir $dir/$newdir
    else
        echo "$dir is not a directory"
    endif
end

echo "DONE"
