I used grep command with \k notify and lookbehind assertion:
$ read name Jan # input Jan $name; echo "The phone number of $name is $(grep -oP "$name;\K.*" telephone)" Jan #Input The phone number of Jan is 032569874 #output#Output grep with -P(perl-regexp) parameter supports \K, which use to ignoring the previously matched characters(ignore name and semicolon;).
-o, --only-matching: print only the matched (non-empty) parts of a matching line.
$(command) "Command Substitution" that allows the output of a command to replace the command name.
Or you can use the lookbehind assertion in place of nifty \K.
$ read name; echo "The phone number of $name is $(grep -oP "(?<=$name;).*" telephone)"