#!/bin/bash cp $1 tmp.out while read line do mv tmp.out tmp.in a=${line%% *} b=${line#* } # echo "$line,$a,$b" sed "s/$a/$b/g" tmp.in > tmp.out done