Calculating bond length in VMD (Visual Molecular Dynamics)

Is there a way to calculate bond length in VMD (Visual Molecular Dynamics)?
I have a lot of trajectory files of water molecule, and I need to calculate the bond length of $\ce{O-H}$ bond, and find the average.


I know that there is a GUI based method to calculate bond lengths in VMD, but can I do the same using a script?


