I ask this question because I met them often in the forest. In the most cases they only run away but in one case the boar blocked our way through a valley. It only looked at us. It did not attack but we could not chase it away with yelling.
Perhaps yelling was the wrong idea? But how should you behave? And how can you prevent to be attacked?