MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | xforall <filepattern> <command> |
| 3 | |
| 4 | DESCRIPTION |
| 5 | Execute <command> for all matching files. The <command> string can |
| 6 | contain replacment marks. Currently there are five of these marks: |
| 7 | - "!!" this mark stands for the full file name. |
| 8 | - "!e" stands for the extension of the file name. |
| 9 | - "!f" stands for the file name without extension and directory name. |
| 10 | - "!h" stands for the full directory name of the files. |
| 11 | - "!r" stands for the full file name without file extension. |
| 12 | - "!t" stands for the file name without the directory name. |
| 13 | |
| 14 | If the full file name would be "/directory/file.ext" then |
| 15 | "!!" equals "/directory/file.ext" |
| 16 | "!e" equals "ext" |
| 17 | "!f" equals "file" |
| 18 | "!h" equals "/directory" |
| 19 | "!r" equals "/directory/file" |
| 20 | "!t" equals "file.ext" |
| 21 | |
| 22 | EXAMPLES |
| 23 | xforall ~/room/*.c xcall !r->reset(); |
| 24 | Call the reset() function in all your rooms. |
| 25 | |
| 26 | xforall ~/obj/* mv !! !h/oldobj/!f.!e.old |
| 27 | Move all files from your "obj" dir into the "obj/oldobj" dir and change |
| 28 | the extensions. |
| 29 | |