tr A-Z a-z <tbl.terms|awk -v file=tbl.terms '{ term=$0 sub("/","\/") sub("\\","\\\\") getline <file print "s/" term "/" $0 "/"}'