Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him)
How can we avoid shaking hands with the opposite sex?
The best thing is to inform the person that your religion does not permit you to shake hands with them out of respect for them.