#!/bin/bash

while read line
do
    for ((c=0;c<${#line};c++))
    do
	k=${line:c:1}
	kn=$(echo $k |tr a-z A-Z)
	while IFS=: read letter code
	do
	    [[ $letter == $kn ]] && echo -n $code
	done < mcode
    done
done
echo 
