#!/bin/csh -f if (-e data3.links) rm data3.links if (-e data4.links) rm data4.links if (-e cora.links) rm cora.links if (-e local.links) rm local.links # Find all links and write their names to the file links find . -type l | sed 's:./::' > links set n_links = `wc -l links | awk '{print $1}'` set n = 1 # Loop over the links, sorting them according to their sorce location while ($n <= $n_links) set link = `tail -n +$n links | head -n 1` set source = `ls -l $link | awk '{print $NF}'` set logged = 0 # Exclude large data files if ( "$link" =~ *tar* || "$link" =~ *.dat4 || "$link" =~ *.EXE || \ "$link" =~ *.zip || "$link" =~ *data ) goto skip if ( "$source" =~ /data3* ) then set logged = 1 if (! ("$link " =~ *data_location*) ) then echo $link >> data3.links endif endif if ( "$source" =~ /data4* ) then set logged = 1 if (! ("$link" =~ *data_location*) ) then echo $link >> data4.links endif endif if ( "$source" =~ /data/cora* ) then set logged = 1 if (! ("$link" =~ data_location) ) then echo $link >> cora.links endif endif if ($logged == 0) then ls -l $link >> local.links endif skip: @ n ++ end