While it is possible to parse the ~/.ssh/config with a simple awk
script, it might not work for arbitrary config file, which may have various blocks, etc. Consider instead using the 'ssh -G', which will dump the parameters of an ssh session, then extract the hostname attribute
ssh -G myAlias | awk '$1 == "hostname" { print $2 }'
Note that this has the advantage of supporting all ssh configuration sources (local config, command line, global config, environment variables, etc).
Just for completeness, quick and dirty awk
solution
awk -v H="myAlias" '
tolower($1) == "host" { m=$2 == H }
tolower($1) == "hostname" && m{ print $2 }
' ~/.ssh/config
-G
. Thanks. – Lobscouse