#!/usr/bin/env bash IFS=: cat < $i" git grep -l "[aA]llows to $v" >files [ -s files ] && xargs perl -i.bak -pe "s/([aA])llows to $v\b/\$1llows $i/g"