I found a cave not too far from the cabins on the south side in Yosemite Valley. As I entered the cave, I was on the lookout for bears, but, thankfully, there weren't any. However, as I turned around inside the entrance, here was a bear making his way straight to the cave. I was trapped. I immediately raised my arms high over my head (I can't remember if I yelled), getting the bear's attention. He stood up and faced me, then tore out to his right as I tore out in the opposite direction back to the cabins! Quite an adenaline rush!