#!/usr/bin/perl if (-l "Makefile") { $source_tree = `ls -l Makefile`; $source_tree =~ s/^.*->\s*(.*)\/Makefile\s*$/$1/; print "Linking to source dir: $source_tree\n"; system("lndir $source_tree"); if ($? == 0) { system("kill-dangling-symlinks"); } else { print "errors from lndir; NOT removing dangling symlinks\n"; } } else { print "Linked Makefile not found."; exit(1); }