#!/usr/local/bin/perl -w

@lines = `ls -l|grep home`;

foreach $line(@lines)
  {
      chomp($line);
      if (($line =~ / (\S*\.pdf) .. (.*\.pdf)/)  || ($line =~ / (\S*\.ps.gz) .. (.*\.ps.gz)/))
      {
	  $link = $1;
	  $target = $2;
	  $target =~ s/\/home\/data/\/afs\/desy.de\/group\/library/;
	  print "rm $link \nln -s $target $link\n";
      }    
  }
