Skip to content
Cody Permann edited this page Mar 2, 2014 · 2 revisions

Run a substitution on every line of code in MOOSE directory

Note: A newline has been inserted after the 'pipe' character for readability in the find command below. You will need to join those two lines before executing this command. Additionally you will need to supply a valid perl substitution operator. It will be executed on every source line in the repository.

cd $MOOSE_DIR
find . \( -name '*.[Chi]' -or -name '*.py' -or \( -name "contrib" -or -name "libmesh" \) -prune -and -type f \) -print0 | 
xargs -0 perl -pli -e "<YOUR SUBSTITUTION REGEX HERE (i.e. s///)>"
Clone this wiki locally