Added global flag, replaced redundant redirection.

Not using the 'g' (global) flag only replaces the first match on a line.  The 'g' flag will replace all matches.