An even better way to un-backslash-escape the filenames from find.
authorWayne Davison <wayned@samba.org>
Sat, 2 Sep 2006 19:57:56 +0000 (19:57 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 2 Sep 2006 19:57:56 +0000 (19:57 +0000)
support/file-attr-restore

index 8c25310..7238b00 100755 (executable)
@@ -48,8 +48,7 @@ while (<>) {
     die "Invalid input line $.:\n$_" unless defined $name;
     die "A filename is not properly escaped:\n$_" unless $name =~ /^[^"\\]*(\\(\d\d\d|\D)[^"\\]*)*$/;
     my $fn = $name;
-    $fn =~ s/([\$\@\%])/\\$1/g;
-    $fn = eval "\"$fn\"";
+    $fn =~ s/\\(\d+|[A-Za-z]|.)/ eval "\"\\$1\"" /eg;
     if ($type eq '-') {
        undef $type unless -f $fn;
     } elsif ($type eq 'd') {