The general solution to this problem is: N*(N-1)/2, thus pertinent to this particular case it would be (10*9)/2= 45 handshakes.
A bit of explanation. This math problem can be reduced to another well-known one of calculating the sum of arithmetic progression: thus, for N people that sum would be:
1+2+3 +...+(N-1) = N*(N-1)/2
For example, the number of handshakes between Justices of the SCOTUS would be: 9*8/2=36, on the US Senate floor it would be 100*99/2 = 4,950 handshakes, and so on.
Hope this may help. Best regards,