/* /secure/cmds/creator/lsed.c * from the Dead Souls LPC Library * an LPC scripted editor * created by Descartes of Borg 950407 */ #include inherit LIB_DAEMON; static void LsedFile(string file, string *cmds, int num_cmds); mixed cmd(string args) { string *files, *lines, *tmp; string total, script, pwd; int i, maxi, x; if( args == "" || !args ) return "Syntax: "; if( (maxi = sizeof(files = explode(args, " "))) == 1 ) return "You must specify the name of a file to run the script on."; pwd = this_player()->query_cwd(); script = absolute_path( pwd, files[0] ); files = files[1..]; maxi--; for(i=0, tmp = ({}); i \n\n" "Allows you to perform editor commands on a file or set of files " "from a script. You simply write a script of editor commands " "and save it to a file. For example, say that you wanted to " "change set_item_functions() to SetItems() and " "set_search_function() to SetSearch() in every file in your home " "directory. You would write a script that looks like:\n\n" "s/set_item_functions/SetItems/g\n" "s/set_search_function/SetSearch/g\n\n" "save it as convert.lsed, and then at the command line type: " "\"lsed sconvert.lsed *\". Keep in mind that the MudOS " "driver will only let an execution thread run so long " "before automatically terminating it with a too long evaluation " "error, so avoid running lsed on a large number of files at " "once.\n" "See also: ed"); }