home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / as1455n6.zip / XFree86 / doc / AfterStep / 1.0_to_1.4 / step2files.pl < prev   
Perl Script  |  1998-05-13  |  738b  |  27 lines

  1. #!/usr/bin/perl
  2. # For extracting all exec lines from a .steprc file
  3. # and puting them in the AfterStep 1.4 format (a file w/
  4. # the command.
  5. #Usage:
  6. #   perl step2files.pl < .steprc > shell_script_name
  7. # Now run the shell script and it will create the files for you:
  8. #   sh shell_script_name
  9. # Then move the files under your start menu however you want them.
  10. #                                    
  11. #
  12. # By Stephan Beal (yoshiko.beal@munich.netsurf.de) 17.3.98
  13. # Released into the Public Domain.
  14.  
  15. @LINES = <STDIN>;
  16. foreach $line (@LINES) {
  17.     if ( $line =~ /(Exec.*\")(.*)(\".*exec)(.*)/ ) {
  18.         $name=$2;
  19.         $cmd = $4;
  20.         $cmd =~ s/^\s//;
  21. #        print $name."=".$cmd."\n";
  22.         print "echo '$cmd' > '$name'\n";
  23.  
  24.     }
  25.  
  26. }
  27.