How to do bulk file-editing in common lisp? -
i'd know how bulk-editing of files in common lisp. needed while , used perl , bash it. i'd know common-lisp solution out of curiousity.
i used following:
find -name '*.lisp' -execdir perl -0777 -pi.bak -e 's/foo/bar/mi' '{}' '+'
and worked charm.
the above command feeds files in directory (and subdirectories) perl program. perl program searches regex "foo" , replaces regex "bar", , saves new (edited) file in place.
thanks guidance can provide on cl solution.
how starting walk-directory, slurp file, close file, replace foo bar, write contents back, , then... rest. ;-)
Comments
Post a Comment