Here's shell script to do it
while read a; do while read b; do echo "$a, $b"; done < file2; done < file1
Though that will be quite slow.
I can't think of any precompiled logic to accomplish this.
The next step for speed would be to do the above in awk/perl.
awk 'NR==FNR { a[$0]; next } { for (i in a) print i",", $0 }' file1 file2
Hmm, how about this hacky solution to use precompiled logic?
paste -d, <(sed -n "$(yes 'p;' | head -n $(wc -l < file2))" file1)
<(cat $(yes 'file2' | head -n $(wc -l < file1)))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…