This should've been in my never-ending history:
$ tex -v | head -n1 | awk '{print $2}'
3.1415926
but it wasn't (I distinctly remember using this line to prove a point a few months ago).