**With join and sort:**
join -t , <(sort given.csv) <(sort family.csv)
Output:
123,John,Lennon
246,Paul,McCartney
369,George,Harrison
987,Ringo,Starr
* * *
**With grep:**
#!/bin/bash
F1="given.csv"
F2="family.csv"
D="," # delimiter
while IFS="$D" read FIRST_COLUMN REST; do
T="$FIRST_COLUMN$D$REST"
T+="$(grep -oP "^$FIRST_COLUMN\K$D.*" "$F2")" && echo "$T"
done < "$F1"
Output:
123,John,Lennon
246,Paul,McCartney
369,George,Harrison
987,Ringo,Starr