home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / m / msh_ut11.zip / WILDRUN.MSH < prev   
Text File  |  1992-04-30  |  3KB  |  65 lines

  1. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  2. || A rather complete wildrun. Take current cmdline, interpret some
  3. || patterns and replace them with certain fileparts and do this for
  4. || all selected files.                                  Jens Pirnay
  5. ||     Parm      Desc           Normal example
  6. ||     ----      ----          -----------------
  7. ||      &f   full file name    c:\dos\thing.dat
  8. ||      &d   directory only    c:\dos
  9. ||      &n   file name only    thing.dat
  10. ||      &r   file name root    thing
  11. ||      &e   extension         exe
  12. ||
  13. (cmd(                               | only if cmdline is not empty
  14.   cmd wld_pattern!                  | store it
  15.   (current.selected                 | loop over all selected files
  16.     (
  17.       current.name wld_name!              | create necessary parts
  18.       current.name "." cutfirst wld_ext!  | from filename
  19.       wld_root!                           |
  20.       cwd current.name makename wld_full! |
  21.       wld_pattern    | push original pattern on stack
  22.       "_" &          | add one char, so that a final &_ is recognized
  23.       ("&f" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  24.       (wld_full swap & &)
  25.       while
  26.       ("&d" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  27.       (cwd swap & &)
  28.       while
  29.       ("&n" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  30.       (wld_name swap & &)
  31.       while
  32.       ("&r" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  33.       (wld_root swap & &)
  34.       while
  35.       ("&e" cutfirst dup (dup)if)         | [top+1] part before, [top] after or empty
  36.       (wld_ext swap & &)
  37.       while
  38.       "_" cutlast drop                    | remove last dummy character
  39.       execute
  40.     )if
  41.   )loop_panel
  42.   refresh
  43.   cmd.clear
  44. )if
  45. )wildrun!                || connected to AltZ for me
  46. ("Wildrun Actions"
  47. " Select the files you want to process, then
  48.   type the command and finally press AltZ.
  49.   Then this command will be executed against
  50.   all selected files.
  51.  
  52.   Following patterns are valid in the command
  53.   line:
  54.     Parm      Desc           Normal example
  55.     ----      ----          -----------------
  56.      &f   full file name    c:\\dos\\xcopy.exe
  57.      &d   directory only    c:\\dos
  58.      &n   file name only    xcopy.exe
  59.      &r   file name root    xcopy
  60.      &e   extension         exe
  61.  (e.g. \"copy &n &r.bak\" makes a backup of all
  62.                           selected files)
  63. "message)wildhelp!      || connected to CtrlZ for me
  64. || wildhelp
  65.