#!/bin/sh for t in *.[ch]; do echo fix $t sed -e 's/replace this text/replacement/g' < $t > $t.new mv $t.new $t done