Aix Shell Programming

HI
I am trying to write a shell script which accepts two strings from user and finds the matching number of characters in those two
ex:
string 1 abcd
string 2 bcgt

result is bc (matching characters)
pls provide me with a basic script for doing that

Your posts are all spin-offs from the same thread - matching characters between strings

Please do not duplicate or cross-post.