Zsh, 19 bytes
grep -oam1 x /*/ur*
Explanation:
/*/ur*: glob for/dev/urandom, a randoman infinite stream of random bytesgrep x: search for the letterx-o: print only the letterxs-a: force output even though/dev/urandomis a binary file-m1: quit after the first matching line
Pure Zsh, 20 bytes
for ((;RANDOM;))<<<x
Loop breaks with probability \$ \frac 1 {32768} \$ for each iteration.
Explanation:
for ((;RANDOM;)): loop while$RANDOM(which is a random integer in the range \$ [0, 32768) \$, is nonzero<<<x: printx
Here's a version for 2 bytes more with a probability of \$ \frac 1 2 \$, and is much more easy to demonstrate:
for ((;RANDOM%2;))<<<x