Como um ilegível awk one-liner
$ awk 'NR>1{a[0]=$3;a[1]=$4;getline<f;for(i=1;i<=NF;i++)$i=a[$i];print}' f=file2 file1
A C A C A A A C
C C T T C T T C
G A A A G G G A
Mais legível:
awk '
# skip the header in file1
NR == 1 {next}
{
# read the values from the file1 line
a[0] = $3
a[1] = $4
# replace the current record with the corresponding line from the map file
getline < map_file
# and now substitute the 0/1 with the values
for (i=1; i<=NF; i++)
$i = a[$i]
print
}
' map_file=file2 file1