ThinkThen

Beatles Bench pages
Scripts
What Jev knows
Tune your bar
Beatles Bench · The ten functions

find picks one from many.

The talk's slide: find picks one from many.
Open the slide at full size.

find reads every line together and picks the one that answers the question. Each line sees the others. An answer can depend on the whole set.

Run it

find picks Love Me Do.
these_songs="These are songs by the Beatles."
question="$these_songs Which one did they release first?"

cat <<'EOF' |
She Loves You
I Saw Her Standing There
From Me to You
All My Loving
Love Me Do
I Want to Hold Your Hand
Please Please Me
Can't Buy Me Love
A Hard Day's Night
I Feel Fine
EOF
thinkthen find "$question" \
  --replay recording
Output
Love Me Do
exit 0: a line came back

The lesson

Love Me Do came out first, and the pick is right.

Without --none, find always names a line. Check its picks on records you know before you trust it.