home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / images / ramdisk2-beta.img / bin / cat < prev    next >
Text File  |  1995-09-03  |  445b  |  26 lines

  1. #!/usr/bin/perl 
  2.  
  3. $rc = 0;
  4.  
  5. if ($0 =~ /cat$/) {
  6.     while (<>) { print };
  7. } elsif ($0 =~ /rm$/) {
  8.     if ($ARGV[0] eq '-f') {
  9.         $force = 1;
  10.         shift(@ARGV);
  11.     } elsif ((substr($ARGV[0], 0, 1)) eq '-') {
  12.         print STDERR "Only -f is supported\n";
  13.         exit(1);
  14.     }
  15.     foreach $file (@ARGV) {
  16.         if ($force) {
  17.             unlink($file);
  18.         } else {
  19.             unlink($file) || print STDERR "couldn't remove $file\n";
  20.         $rc = 1;
  21.         }
  22.     }
  23. }
  24.  
  25. exit($rc);
  26.