support filenames with spaces
authorDobrica Pavlinusic <dpavlin@rsync1.maxxo.com>
Sat, 11 Feb 2012 18:36:22 +0000 (19:36 +0100)
committerDobrica Pavlinusic <dpavlin@rsync1.maxxo.com>
Sat, 11 Feb 2012 18:36:22 +0000 (19:36 +0100)
migrate-md5-attr.pl

index 8d11867..5e28870 100755 (executable)
@@ -23,7 +23,11 @@ while(<$passwd>) {
 
        while( my($k,$v) = each(%h) ) {
                #print "$v  $k\n";
-               system "attr -s md5 -V $v $dir/$k";
+               if ( -e "$dir/$k" ) {
+                       system 'attr', '-s', 'md5', '-V', $v, "$dir/$k";
+               } else {
+                       warn "SKIP $dir/$k\n";
+               }
        }
 
        untie %h;