#!/bin/sh
thisdir=`pwd`
for builddir in `ls -d PLAT_*/Xyce_*`
do
  if [ -d $builddir/Xyce_Test ]
  then
    cd $builddir/Xyce_Test/Netlists
    for i in /Net/Proj/Xyce/people/tvrusso/Xyce_Test/Netlists/*
    do
      if [ $i != "/Net/Proj/Xyce/people/tvrusso/Xyce_Test/Netlists/CVS" ]
      then
        if [ -d $i ]
        then
          newdir=`echo $i | sed -e 's-/Net/Proj/Xyce/people/tvrusso/Xyce_Test/Netlists/--'`
          if [ ! -d $newdir ]
          then
            echo "$newdir is new, linking..."
            mkdir $newdir
            cd $newdir
            for j in $i/*
            do 
              if [ $j != $i/CVS ]
              then
                ln -s $j .
             fi
            done
            cd ..
          fi
        fi
      fi
    done    
    cd $thisdir
  fi
done
