#!/usr/bin/perl # cpt dir1 dir2 # Cpt dir1 dir2 # lnt dir1 dir2 # Lnt dir1 dir2 # # This does a recursive copy or link from dir1 to dir2. The result will be # that dir1 is "merged into" dir2. Care is taken to ensure that links are # preserved. for (@ARGV) { if (/^-(.*)/) { continue; } if (!$dir1) { $dir1 = $_; } elsif (!$dir2) { $dir2 = $_; } else { } } die "Usage: $0 dir1 dir2\n" if (!($dir1 && $dir2)); &onedir($dir1,$dir2); exit 0; sub onedir { local($d1,$d2) = @_; ... }