Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
502 B

  1. #!/usr/bin/perl
  2. $| = 1;
  3. if ($#ARGV >= 0) {
  4. $cmd = join(' ',@ARGV);
  5. }
  6. else {
  7. print "Command: ";
  8. $cmd = <stdin>;
  9. chop($cmd);
  10. while ($cmd =~ s/\\$//) {
  11. print "+ ";
  12. $cmd .= <stdin>;
  13. chop($cmd);
  14. }
  15. }
  16. $cwd = `pwd`; chop($cwd);
  17. open(FIND,'find . -type d -print|') || die "Can't run find";
  18. while (<FIND>) {
  19. chop;
  20. unless (chdir $_) {
  21. print stderr "Can't cd to $_\n";
  22. next;
  23. }
  24. print "\t--> ",$_,"\n";
  25. system $cmd;
  26. chdir $cwd;
  27. }