/Magic One Liners

Change a word in many files

The below one liner will open all files in its path and change the word 'MOO' in any of the files to the word 'BOO'. find . -type f | xargs /usr/iw-home/iw-perl/bin/iwperl -i -p -e 's/MOO/BOO/g;' This script has only been lightly tested so please make a backup of your files before running this!

By |2008-09-27T14:23:24+00:00September 27th, 2008|Magic One Liners, Perl|0 Comments

Perl Magic One Liners

This page is dedicated to all the quick one line utilities that are useful when managing an Interwoven system or any other system that uses many files. Find all files without metadata of content_type: find . -name '*.xml' -exec /iw-home/iw-perl/bin/iwperl -e '$file=shift;system("/iw-home/bin/iwextattr", -g=> "TeamSite/Metadata/content_type", $file);warn "$filen" if $?' {} ';' >/dev/null Regenerate Recursively find . [...]

By |2008-07-02T09:25:53+00:00July 2nd, 2008|Magic One Liners, Perl|0 Comments